@@ -10,7 +10,7 @@ use std::fmt;
1010#[ derive( Clone , Default ) ]
1111pub struct ClientTlsConfig {
1212 domain : Option < String > ,
13- cert : Option < Certificate > ,
13+ certs : Vec < Certificate > ,
1414 identity : Option < Identity > ,
1515 assume_http2 : bool ,
1616}
@@ -19,7 +19,7 @@ impl fmt::Debug for ClientTlsConfig {
1919 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
2020 f. debug_struct ( "ClientTlsConfig" )
2121 . field ( "domain" , & self . domain )
22- . field ( "cert" , & self . cert )
22+ . field ( "cert" , & self . certs )
2323 . field ( "identity" , & self . identity )
2424 . finish ( )
2525 }
@@ -30,7 +30,7 @@ impl ClientTlsConfig {
3030 pub fn new ( ) -> Self {
3131 ClientTlsConfig {
3232 domain : None ,
33- cert : None ,
33+ certs : Vec :: new ( ) ,
3434 identity : None ,
3535 assume_http2 : false ,
3636 }
@@ -46,10 +46,9 @@ impl ClientTlsConfig {
4646
4747 /// Sets the CA Certificate against which to verify the server's TLS certificate.
4848 pub fn ca_certificate ( self , ca_certificate : Certificate ) -> Self {
49- ClientTlsConfig {
50- cert : Some ( ca_certificate) ,
51- ..self
52- }
49+ let mut certs = self . certs ;
50+ certs. push ( ca_certificate) ;
51+ ClientTlsConfig { certs, ..self }
5352 }
5453
5554 /// Sets the client identity to present to the server.
@@ -75,7 +74,7 @@ impl ClientTlsConfig {
7574 None => uri. host ( ) . ok_or_else ( Error :: new_invalid_uri) ?,
7675 } ;
7776 TlsConnector :: new (
78- self . cert . clone ( ) ,
77+ self . certs . clone ( ) ,
7978 self . identity . clone ( ) ,
8079 domain,
8180 self . assume_http2 ,
0 commit comments