在Mac上安装了Python 3.6版本,使用urllib库访问网页却返回了
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)
1
这样的错误。
这是由于MacOS版本的python 3.6版本没有使用系统的openssl进行证书验证。在/Applications/Python\ 3.6/目录下可以找到Readme.rtf文件,其中说明到:
NEW This variant of Python 3.6 now includes its own private copy of OpenSSL 1.0.2. Unlike previous releases, the deprecated Apple-supplied OpenSSL libraries are no longer used. This also means that the trust certificates in system and user keychains managed by the Keychain Access application and the security command line utility are no longer used as defaults by the Python ssl module.
解决方法是运行/Applications/Python\ 3.6/Install\ Certificates.command命令,安装certifi模块即可。
可见stackoverflow上的帖子:
urllib and “SSL: CERTIFICATE_VERIFY_FAILED” Error
分享到:
相关推荐
今天遇到一个奇怪的问题,在用urllib打开一个https链接的时候,出现了一下报错信息:IOError: [Errno socket error] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727),报错问题就是证书...
安装配置nacl sdk环境时,命令naclsdk update,报错third_party.fancy_urllib.InvalidCertificateException: Host storage.googleapis.com returned an invalid certificate ([SSL: CERTIFICATE_VERIFY_FAILED] ...
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) urllib或requests在打开https站点是会验证证书,简单的处理方式就是把发送https请求时把验证ssl证书关掉,即设置verify为...
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:...
使用python直接使用pip install xx时,出现 Could not fetch URL https://pypi.python.org/simple/requests/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate ...
#WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate ...
urlopen错误[SSL:CERTIFICATE_VERIFY_FAILED]证书验证失败:无法获取本地发行者证书(_ssl.c:1049)',因此我使用了此代码诡计 reopen your terminal and type 'pip install --upgrade certifi' will if it did ...
CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)'),) ============ 1 2 3 4 5 6 这个错误是因为python‐2.7.5‐e58版本默认是使用ssl验证,为了解决这个问题需要关闭此验证 或者降级python...
Could not fetch URL ...(Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate ve
当遇到SSL证书问题时,如示例中的“SSLError: [SSL: CERTIFICATE_VERIFY_FAILED]certificate verify failed”,这通常是因为服务器的SSL证书未被Python认可。在某些情况下,为了继续请求,我们可以关闭证书验证,但...
如果在尝试安装像xlwt这样的包时,报错`SSL:CERTIFICATE_VERIFY_FAILED`,这通常意味着Python的SSL库无法验证pypi.python.org的证书。对于Python的低版本,可能缺少SSL支持或者证书库未更新。解决这个问题的一个方法...
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL:CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)'...