I am trying to retrieve webcam snapshots from this website with Requests, but I get the following error:
requests.exceptions.SSLError: HTTPSConnectionPool(host='secure.rcrquebec.com', port=443): Max retries exceeded with url: /webcams/msa.webcamExpert01/Webcam.jpg (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),))
If I look the image/page with Google Chrome in debug mode, the security overview tells me that the page has a valid certificate, but uses obsolete protocol. My understanding is that this is the reason for my SSLError. Chrome's security overview says that:
The connection to this site uses TLS 1.0 (an obsolete protocol), RSA (an obsolete key exchange), and 3DES_EDE_CBC with HMAC-SHA1 (an obsolete cipher).
So I tried to force Requests to use SSL Version 1.0 as explained here without any success.
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.poolmanager import PoolManager
import ssl, requests
class MyAdapter(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('https://', MyAdapter())
r = s.get('https://secure.rcrquebec.com/webcams/msa.webcamExpert01/Webcam.jpg')
Do I need to account for the obsolete key exchange and cipher as well? If yes how?