Skip to content Skip to sidebar Skip to footer

Bad Handshake When Using Requests

I was trying to download a PDF file from Internet and Python2.7.15cr1 and requests 2.19.1 but I am facing this error: > Traceback (most recent call last): > File 'd

Solution 1:

This server is hopelessly broken. According to the SSLLabs report it only supports TLS 1.0 and only insecure or weak ciphers using DES or 3DES. These ciphers are disabled by default in requests.

If you still want to connect to the server you explicitly need to allow the weak 3DES cipher. As already described in Requests failing to connect to a TLS server this works like this:

import requests 
requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS = 'DES-CBC3-SHA' 
resp=requests.get('https://www.gasnaturalfenosa.com/en/files/GasNaturalSDG_ing_2016-2.pdf')

Post a Comment for "Bad Handshake When Using Requests"