Certificate verify failed: unable to get local issuer certificate
时间: 2023-07-19 19:54:51 浏览: 70
这个错误通常是由于 SSL/TLS 证书不被信任所致。它可能是由于证书颁发机构(CA)没有被信任,或者证书链不完整。你可以尝试更新根证书或者手动指定证书的路径。如果你是在使用 Python 时遇到了这个问题,可以尝试使用 `verify=False` 参数来禁用 SSL/TLS 验证。但是这样做会降低安全性,因此不建议在生产环境中使用。
相关问题
certificate verify failed: unable to get local issuer certificate
This error occurs when a secure connection (such as HTTPS) is attempted but the server's SSL/TLS certificate cannot be verified by the client's system. This can happen when the server's certificate is not signed by a trusted certificate authority, or if the client's system does not have the necessary root or intermediate certificates to verify the chain of trust.
To resolve this error, you can try the following steps:
1. Verify that the server's certificate is valid and signed by a trusted certificate authority.
2. Make sure that the client's system has the necessary root and intermediate certificates installed to verify the chain of trust.
3. Check if there are any firewalls, proxies or security software that may be interfering with the SSL/TLS connection.
4. Try accessing the website or server from a different network or device to see if the issue persists.
5. If the problem persists, contact the website or server administrator for assistance.
certificate verify failed: unable to get local issuer certificate (_ssl.c:1091)>
当使用urllib包打开https链接时,可能会遇到"certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)"这个错误。这个错误的原因是因为在Python 2.7.9之后的版本中,urllib会验证SSL证书。当目标网站使用的是自签名的证书时,就会抛出这个异常。解决这个问题的方法是可以通过以下步骤进行操作:
1. 在Python代码中加入import ssl的语句来引入ssl模块。
2. 添加ssl._create_default_https_context = ssl._create_unverified_context的代码行,这样可以创建一个未经验证的SSL上下文。
通过以上操作,你就可以成功解决"certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)"的问题。这样你就可以继续使用urllib包来打开https链接了。