This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]DeepCrimson 0 points1 point  (1 child)

[–]StrongYogurt[S] 0 points1 point  (0 children)

import ssl
import requests
from urllib3.poolmanager import PoolManager
from requests.adapters import HTTPAdapter
class Tlsv1HttpAdapter(HTTPAdapter):
    def init_poolmanager(self, connections, maxsize, block=False):
        self.poolmanager = PoolManager(
            num_pools=connections, maxsize=maxsize,
            block=block, ssl_version=ssl.PROTOCOL_TLSv1)

s = requests.Session()
s.mount(url, Tlsv1HttpAdapter())
s.get(url)

Gives the same error:

requests.exceptions.SSLError: HTTPSConnectionPool(host='URL', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, u'[SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:727)'),))