The list of available cipher suites can be found by running “openssl ciphers” in the terminal. That variable takes a string parameter of all the cipher suites that you need to allow separated with a “:”. You can control the Cipher List through the CIPHERS variable. request ( 'GET', '' ) print ( r ) except Exception as exception : print ( exception )įollowing are the important points to note: poolmanager = PoolManager ( * pool_args, ssl_context = ctx, ** pool_kwargs ) session = requests. create_urllib3_context ( ciphers = CIPHERS, cert_reqs = ssl. _init_ ( ** kwargs ) def init_poolmanager ( self, * pool_args, ** pool_kwargs ): ctx = ssl_. ssl_options = ssl_options super ( TlsAdapter, self ). Import ssl import requests from requests.adapters import HTTPAdapter from import PoolManager from import ssl_ CIPHERS = ( 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384: ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:AES256-SHA' ) class TlsAdapter ( HTTPAdapter ): def _init_ ( self, ssl_options = 0, ** kwargs ): self.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |