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

报错

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

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

解决方法

设置verify=False,跳过SSL证书验证:

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

并关闭SSL未验证警告:

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)
上一篇:Codeforces Round #773 (Div. 2)补题记录


下一篇:安卓自定义软键盘