requests连接https的问题
sslv3 alert handshake failure错误,参考https://stackoverflow.com/questions/31730819/python-sslerror-using-requests-for-surveymonkey-com
requests.exceptions.SSLError: HTTPSConnectionPool(host='125.71.214.6', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, u'[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:661)'),))
头里面添加如下代码即可(linux上问题解决)
import requests.packages.urllib3.util.ssl_
requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS = 'ALL'
证书校验错误
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
网站不是官方的公钥,如下,添加verify参数为False问题即解决
response = requests.get(url, params=data, headers=security_headers, timeout=2, verify=False)
好记性不如烂笔头