pythonshell开始信任WSS证书

2024-09-28 01:28:23 发布

您现在位置:Python中文网/ 问答频道 /正文

通过python请求访问任何网站时,我都面临SSL证书验证错误

我使用的示例代码:

import requests
url='https://investor.apple.com/investor-relations/default.aspx'
re=requests.get(url)
print(re.status_code)

我得到了以下错误:

SSLError: HTTPSConnectionPool(host='investor.apple.com', port=443): Max retries exceeded with url: /investor-relations/default.aspx (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))) 

我使用的是Windows7,Python3.x,安全性:symantec端点保护

我与WSS团队讨论同一问题时的答复是:

the issue is related to Python or the shell application not trusting the WSS Cloud certificate. This application or its shell is using its own CA certificate bundle and doesn't follow what you have installed on the windows cert store. That is the reason why you are not having the error when accessing the same via the browser.

他们说的解决办法是: 解决方案是让Python shell开始信任WSS云根CA及其子CA(如果需要)

那么,如何让python shell开始信任WSS证书呢

多谢各位


Tags: thecomurlsslappleis错误certificate

热门问题