其他分享
首页 > 其他分享> > OpenSSL.SSL.Error、InsecureRequestWarning、SSLError: bad handshake 报错

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)

标签:handshake,verify,urllib3,OpenSSL,SSL,报错,Error,InsecureRequestWarning
来源: https://blog.csdn.net/lilongsy/article/details/121676237