@@ -474,21 +474,6 @@ def _request(self, method, url, options):
474
474
475
475
return ResponseWrapper (response , self .request_size )
476
476
477
- def _get_new_tls_config (self , url , new_options ):
478
- """
479
- Creates a new TLS config if the new request options differ from the default ones.
480
- """
481
- # If `verify` or `cert` options differ from the defaults, a new adapter is created.
482
- if new_options .get ('verify' ) == self .options ['verify' ] and new_options .get ('cert' ) == self .options ['cert' ]:
483
- return self .tls_config
484
- if not url .startswith ('https' ):
485
- return self .tls_config
486
- requested_tls_config = get_tls_config_from_options (new_options )
487
- self .logger .debug ('Overrides for new context config: %s' , requested_tls_config )
488
- new_tls_config = self .tls_config .copy ()
489
- new_tls_config .update (requested_tls_config )
490
- return new_tls_config
491
-
492
477
def make_request_aia_chasing (self , request_method , method , url , new_options , persist ):
493
478
try :
494
479
response = request_method (url , ** new_options )
@@ -578,12 +563,13 @@ def load_intermediate_certs(self, der_cert, certs):
578
563
self .load_intermediate_certs (intermediate_cert , certs )
579
564
return certs
580
565
581
- def _create_session (self , tls_config = None ):
582
- session = requests .Session ()
583
- config = self .tls_config if tls_config is None else tls_config
584
-
585
- self ._mount_https_adapter (session , config )
566
+ def _create_session (self ):
567
+ """
568
+ Initializes requests.Session and configures it with a UDS Adapter and options coming from user's config.
586
569
570
+ We leave it to callers to mount any HTTPS adapters if necessary.
571
+ """
572
+ session = requests .Session ()
587
573
# Enable Unix Domain Socket (UDS) support.
588
574
# See: https://github.com/msabramo/requests-unixsocket
589
575
session .mount ('{}://' .format (UDS_SCHEME ), requests_unixsocket .UnixAdapter ())
0 commit comments