requests_ssl.py 581 B

1234567891011121314
  1. import ssl
  2. from requests.adapters import HTTPAdapter
  3. from requests.packages.urllib3.poolmanager import PoolManager
  4. class SSLv3Adapter(HTTPAdapter):
  5. '''An HTTPS Transport Adapter that uses SSLv3 rather than the default
  6. SSLv23, for servers which only speak v3.'''
  7. def init_poolmanager(self, connections, maxsize, block=False):
  8. self.poolmanager = PoolManager(num_pools=connections,
  9. maxsize=maxsize,
  10. block=block,
  11. ssl_version=ssl.PROTOCOL_SSLv3)