python - 请求.exceptions.SSLError : hostname 'boxfwd.com' doesn't match either of 'nycmsk.com' , 'www.nycmsk.com'

标签 python ssl https python-requests

非常简单的 python 示例:

import requests

c = requests.get(u'https://boxfwd.com').content
print c

在我的本地计算机上一切正常。

但是在服务器上我看到这个错误:

requests.exceptions.SSLError: hostname 'boxfwd.com' doesn't match either of 'nycmsk.com', 'www.nycmsk.com'

为什么我在服务器上看到这个错误?

在浏览器中,我看到了指向 *.boxfwd.com certificate 的证书

最佳答案

似乎在您的服务器中还托管了另一个域 (nycmsk.com),并且 requests 获取了该证书。

在这里寻找潜在的解决方案:https://2.python-requests.org/en/master/community/faq/#what-are-hostname-doesn-t-match-errors

也可能重复:using requests with TLS doesn't give SNI support

关于python - 请求.exceptions.SSLError : hostname 'boxfwd.com' doesn't match either of 'nycmsk.com' , 'www.nycmsk.com',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32667485/

相关文章:

python opencv2 findHomography

ios - 如何保护来自代理的api调用

python - tkinter messagebox 中的格式化方法

python - 在保持值(value)关联的同时在 Pandas 中重新采样

python - 在 Python 中使用企业证书颁发机构进行 HTTPS 证书验证

没有 SSL 的 WCF 身份验证

sql - ORA-29024 : Certificate validation failure

ruby - 如何使用特定的签名证书从 HTTPS 连接验证 SSL 证书?

python - BeautifulSoup 抓取备用 div

.net - 如何设置 WCF 服务和 MVC 站点共享同一个 SSL 证书?