4
我最近買了一個SSL證書爲我的網站:爲什麼Python的`requests`拒絕我的SSL證書,哪些瀏覽器接受
https://ram.rachum.com/
它在瀏覽器中的偉大工程。但它失敗requests
:
>>> import requests
>>> requests.get('https://ram.rachum.com')
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
requests.get('https://ram.rachum.com')
File "C:\Python27\lib\site-packages\requests\api.py", line 55, in get
return request('get', url, **kwargs)
File "C:\Python27\lib\site-packages\requests\api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Python27\lib\site-packages\requests\sessions.py", line 354, in request
resp = self.send(prep, **send_kwargs)
File "C:\Python27\lib\site-packages\requests\sessions.py", line 460, in send
r = adapter.send(request, **kwargs)
File "C:\Python27\lib\site-packages\requests\adapters.py", line 250, in send
raise SSLError(e)
SSLError: hostname 'ram.rachum.com' doesn't match either of '*.webfaction.com', 'webfaction.com'
爲什麼?爲什麼requests
查看webfaction證書而不是我自己的證書,該證書適用於ram.rachum.com
?
在Python 3下使用'requests'確實有效。謝謝! –
我也使用webfaction,得到相同的錯誤消息,購買了靜態IP升級(+ $ 5 /月),但錯誤仍然存在。想法? –
@MarcMaxson:請不要在一些舊的答案中提出問題。最好用足夠的細節(比如域名)來開一個新的問題。 –