Total Complexity | 2 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Coverage | 80% |
Changes | 0 |
1 | # Ciphers compatible with SAT Services |
||
2 | 1 | from requests.adapters import HTTPAdapter |
|
3 | 1 | from urllib3.util import create_urllib3_context |
|
4 | |||
5 | 1 | CIPHERS = ( |
|
6 | 'ECDHE+AESGCM:ECDHE+CHACHA20:DHE+AESGCM:DHE+CHACHA20:ECDH+AESGCM:' |
||
7 | 'DH+AESGCM:ECDH+AES:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!eNULL:!MD5:!DSS' |
||
8 | ':HIGH:!DH' |
||
9 | ) |
||
10 | |||
11 | |||
12 | 1 | class SSLAdapter(HTTPAdapter): |
|
13 | 1 | def init_poolmanager(self, *args, **kwargs): |
|
14 | 1 | kwargs['ssl_context'] = create_urllib3_context(ciphers=CIPHERS) |
|
15 | 1 | return super().init_poolmanager(*args, **kwargs) |
|
16 | |||
17 | 1 | def proxy_manager_for(self, *args, **kwargs): |
|
18 | kwargs['ssl_context'] = create_urllib3_context(ciphers=CIPHERS) |
||
19 | return super().proxy_manager_for(*args, **kwargs) |
||
20 |