admin管理员组文章数量:1618732
解决方法
在使用request请求前,设置一下:
import requests.packages.urllib3.util.ssl_
requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS = 'ALL'
其他解决方法
博主发现网上有很多其他方法,经过尝试,上面的【解决方法】虽然解决了博主的问题,但是可能没法解决小伙伴们的问题,所以列出几个当时查到的解决方法:
方法1
来源:https://blog.csdn/weixin_46084750/article/details/125491776
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
方法2
来源:https://stackoverflow/questions/35405092/sslerror-sslv3-alert-handshake-failure
easy_install pyOpenSSL
easy_install ndg-httpsclient
easy_install pyasn1
easy_install
可用pip install
替换
方法3
来源:https://blog.csdn/qq_37435462/article/details/121564961
使用request请求URL时,使用下面的方法:
import ssl
import socket
hostname="www.baidu" # 这里替换为目标URL
ssl.SSLContext().wrap_socket(socket.socket(socket.AF_INET,socket.SOCK_STREAM), server_hostname=hostname)
方法4(慎用)
来源:https://groups.google/g/google-apps-manager/c/CEG7YvNfPmg
export GAM_TLS_MIN_VERSION=TLSv1.2
本文标签: 报错requestPythonSSLSSLV3ALERTHANDSHAKEFAILURE
版权声明:本文标题:解决python使用request请求报错SSL: SSLV3_ALERT_HANDSHAKE_FAILURE 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/xitong/1728784920a1173202.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论