OpenSSL.SSL.Error、InsecureRequestWarning、SSLError: bad handshake

created at 12-06-2021 views: 30

error

OpenSSL.SSL.Error: [('SSL routines', 'ssl3_get_record', 'wrong version number')]

SSLError: bad handshake: Error([('SSL routines', 'SSL3_GET_SERVER_CERTIFICATE', 'certificate verify failed')],)

Solution

Set verify=False to skip SSL certificate verification:

resp=requests.get(url,headers=headers,verify=False)

And turn off the SSL unverified warning:

1004: InsecureRequestWarning: Unverified HTTPS request is being made to host 'wappass.xxxx.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
created at:12-06-2021
edited at: 12-06-2021: