Python SSL CERTIFICATE_VERIFY_FAILED [英] Python SSL CERTIFICATE_VERIFY_FAILED
问题描述
我正在使用以下代码通过XMLRPC API与Magento网络商店进行交互. Magento API Python XMLRPC
I'm using the following code to interact with a Magento webstore using the XMLRPC api. Magento API Python XMLRPC
一切正常,直到我们在Web服务器上将SSL更改为
Everything was working ok until we made a change on our web server to SSL
现在我遇到以下错误.
ssl.SSLError:[SSL:CERTIFICATE_VERIFY_FAILED]证书验证失败(_ssl.c:581)
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
我不确定证书为什么会失败,因为我们拥有EV证书,并且所有浏览器都将其显示为正常.
I'm not sure why the certificate is failing as we have an EV certificate and all browsers are showing this as ok.
我的连接字符串是:
如何解决此问题/覆盖代码
How can I resolve this / over-ride the code
我对Python还是很陌生,所以请轻松一点:o)
I'm fairly new to Python so please go easy :o)
<代码>magento = MagentoAPI("www.website.co.uk",443,"myUsername","myPassword","/api/xmlrpc",True)
推荐答案
Python,或者更好的是它正在使用的OpenSSL库,无法验证服务器证书的有效性.可能有许多原因:配置错误,缺少中间证书或CA证书,错误的CN ...
Python, or better the OpenSSL library it is using, can not verify the validity of the certificate of the server. There are many possible reasons: bad configuration, missing intermediate or CA certificate, wrong CN...
第一步可能是转到此站点,并使其测试服务器的SSL/TLS功能:https://www.ssllabs.com/ssltest/
A first step could be to go to this site and let it test the SSL/TLS capabilities of the server: https://www.ssllabs.com/ssltest/
它还会为您提供有关如何解决问题的提示.
It will give you hints on how to solve problems as well.
这篇关于Python SSL CERTIFICATE_VERIFY_FAILED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!