File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 1
1
# Ciphers compatible with SAT Services
2
+ import ssl
3
+
4
+ import certifi
2
5
from requests .adapters import HTTPAdapter
3
- from urllib3 .util import create_urllib3_context
4
6
5
7
CIPHERS = (
6
8
'ECDHE+AESGCM:ECDHE+CHACHA20:DHE+AESGCM:DHE+CHACHA20:ECDH+AESGCM:'
7
9
'DH+AESGCM:ECDH+AES:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!eNULL:!MD5:!DSS'
8
10
':HIGH:!DH'
9
11
)
10
12
13
+ ssl_context = ssl .create_default_context (cafile = certifi .where ())
14
+ ssl_context .set_ciphers (CIPHERS )
15
+
11
16
12
17
class SSLAdapter (HTTPAdapter ):
13
18
def init_poolmanager (self , * args , ** kwargs ):
14
- kwargs ['ssl_context' ] = create_urllib3_context ( ciphers = CIPHERS )
19
+ kwargs ['ssl_context' ] = ssl_context
15
20
return super ().init_poolmanager (* args , ** kwargs )
16
21
17
22
def proxy_manager_for (self , * args , ** kwargs ):
18
- kwargs ['ssl_context' ] = create_urllib3_context ( ciphers = CIPHERS )
23
+ kwargs ['ssl_context' ] = ssl_context
19
24
return super ().proxy_manager_for (* args , ** kwargs )
You can’t perform that action at this time.
0 commit comments