From 25883ceb8ae475f00791850b5dbe43e0e27bc433 Mon Sep 17 00:00:00 2001 From: SatCFDI Date: Fri, 19 Jul 2024 12:42:21 -0600 Subject: [PATCH] Removed deprecated code --- satcfdi/sat_requests_utils.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/satcfdi/sat_requests_utils.py b/satcfdi/sat_requests_utils.py index 1ac5799..a70ddbb 100644 --- a/satcfdi/sat_requests_utils.py +++ b/satcfdi/sat_requests_utils.py @@ -1,6 +1,8 @@ # Ciphers compatible with SAT Services +import ssl + +import certifi from requests.adapters import HTTPAdapter -from urllib3.util import create_urllib3_context CIPHERS = ( 'ECDHE+AESGCM:ECDHE+CHACHA20:DHE+AESGCM:DHE+CHACHA20:ECDH+AESGCM:' @@ -8,12 +10,15 @@ ':HIGH:!DH' ) +ssl_context = ssl.create_default_context(cafile=certifi.where()) +ssl_context.set_ciphers(CIPHERS) + class SSLAdapter(HTTPAdapter): def init_poolmanager(self, *args, **kwargs): - kwargs['ssl_context'] = create_urllib3_context(ciphers=CIPHERS) + kwargs['ssl_context'] = ssl_context return super().init_poolmanager(*args, **kwargs) def proxy_manager_for(self, *args, **kwargs): - kwargs['ssl_context'] = create_urllib3_context(ciphers=CIPHERS) + kwargs['ssl_context'] = ssl_context return super().proxy_manager_for(*args, **kwargs)