@@ -331,7 +331,7 @@ pub struct ClientOptions {
331331 proxy_ca_certificate : Option < String > ,
332332 proxy_excludes : Option < String > ,
333333 allow_http : ConfigValue < bool > ,
334- allow_insecure : ConfigValue < bool > ,
334+ allow_invalid_certificates : ConfigValue < bool > ,
335335 timeout : Option < ConfigValue < Duration > > ,
336336 connect_timeout : Option < ConfigValue < Duration > > ,
337337 read_timeout : Option < ConfigValue < Duration > > ,
@@ -366,7 +366,7 @@ impl Default for ClientOptions {
366366 proxy_ca_certificate : None ,
367367 proxy_excludes : None ,
368368 allow_http : Default :: default ( ) ,
369- allow_insecure : Default :: default ( ) ,
369+ allow_invalid_certificates : Default :: default ( ) ,
370370 timeout : Some ( Duration :: from_secs ( 30 ) . into ( ) ) ,
371371 connect_timeout : Some ( Duration :: from_secs ( 5 ) . into ( ) ) ,
372372 read_timeout : None ,
@@ -396,7 +396,9 @@ impl ClientOptions {
396396 pub fn with_config ( mut self , key : ClientConfigKey , value : impl Into < String > ) -> Self {
397397 match key {
398398 ClientConfigKey :: AllowHttp => self . allow_http . parse ( value) ,
399- ClientConfigKey :: AllowInvalidCertificates => self . allow_insecure . parse ( value) ,
399+ ClientConfigKey :: AllowInvalidCertificates => {
400+ self . allow_invalid_certificates . parse ( value)
401+ }
400402 ClientConfigKey :: ConnectTimeout => {
401403 self . connect_timeout = Some ( ConfigValue :: Deferred ( value. into ( ) ) )
402404 }
@@ -442,7 +444,9 @@ impl ClientOptions {
442444 pub fn get_config_value ( & self , key : & ClientConfigKey ) -> Option < String > {
443445 match key {
444446 ClientConfigKey :: AllowHttp => Some ( self . allow_http . to_string ( ) ) ,
445- ClientConfigKey :: AllowInvalidCertificates => Some ( self . allow_insecure . to_string ( ) ) ,
447+ ClientConfigKey :: AllowInvalidCertificates => {
448+ Some ( self . allow_invalid_certificates . to_string ( ) )
449+ }
446450 ClientConfigKey :: ConnectTimeout => self . connect_timeout . as_ref ( ) . map ( fmt_duration) ,
447451 ClientConfigKey :: ReadTimeout => self . read_timeout . as_ref ( ) . map ( fmt_duration) ,
448452 ClientConfigKey :: DefaultContentType => self . default_content_type . clone ( ) ,
@@ -543,8 +547,8 @@ impl ClientOptions {
543547 /// as a last resort or for testing
544548 ///
545549 /// </div>
546- pub fn with_allow_invalid_certificates ( mut self , allow_insecure : bool ) -> Self {
547- self . allow_insecure = allow_insecure . into ( ) ;
550+ pub fn with_allow_invalid_certificates ( mut self , allow_invalid_certificates : bool ) -> Self {
551+ self . allow_invalid_certificates = allow_invalid_certificates . into ( ) ;
548552 self
549553 }
550554
@@ -870,7 +874,7 @@ impl ClientOptions {
870874 builder = builder. http2_prior_knowledge ( )
871875 }
872876
873- if self . allow_insecure . get ( ) ? {
877+ if self . allow_invalid_certificates . get ( ) ? {
874878 builder = builder. danger_accept_invalid_certs ( true )
875879 }
876880
0 commit comments