Skip to content

Commit

Permalink
Removed deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
satcfdi committed Jul 19, 2024
1 parent f9007aa commit 25883ce
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions satcfdi/sat_requests_utils.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
# 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:'
'DH+AESGCM:ECDH+AES:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!eNULL:!MD5:!DSS'
':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)

0 comments on commit 25883ce

Please sign in to comment.