简体   繁体   English

Android 存储库 SSL CERTIFICATE_VERIFY_FAILED

[英]Android repo SSL CERTIFICATE_VERIFY_FAILED

I'm trying to follow Google's documentation to build my own version of Android, but it fails on the "repo init" state (step 2 of section 2): https://source.android.com/source/downloading.html我正在尝试按照 Google 的文档来构建我自己的 Android 版本,但它在“repo init”状态下失败(第 2 节的第 2 步): https : //source.android.com/source/downloading.html

When I run 'repo init -u https://android.googlesource.com/platform/manifest'当我运行'repo init -u https://android.googlesource.com/platform/manifest'

it answers with它回答

fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)

I don't really know what to try, besides making sure I have all the proper tools ( I do, a brand new Macbook Pro w/ El Capitan, Python 2.7, GPG installed, all of that.) What could I have forgotten to do?我真的不知道该尝试什么,除了确保我拥有所有合适的工具(我知道,一个全新的 Macbook Pro w/El Capitan,Python 2.7,安装了 GPG,所有这些。)我还能忘记什么做? Is there anything I can do to disable the SSL check, change the certificate, or anything like that?我可以做些什么来禁用 SSL 检查、更改证书或类似的东西?

Python, since v2.7.9, will by default now check the SSL certificates.从 v2.7.9 开始,Python 现在默认检查 SSL 证书。 To revert to the correct behavior for the repo script, set up an environment variable PYTHONHTTPSVERIFY=0.要恢复 repo 脚本的正确行为,请设置环境变量 PYTHONHTTPSVERIFY=0。

This will shut off all certificate verification.这将关闭所有证书验证。

The repo script should now run as advertised.回购脚本现在应该像宣传的那样运行。

Most likely this is happening because you're using macports python.很可能发生这种情况是因为您使用的是 macports python。

$ port select --list python
Available versions for python:
    none
    python26-apple
    python27 (active)
    python27-apple
$ sudo port select --set python python27-apple
Selecting 'python27-apple' for 'python' succeeded. 'python27-apple' is now active.

The underlying problem is that OS X stores CA root certificates in the Keychain ring, but python.org python does not query the Keychain ring.潜在的问题是 OS X 将 CA 根证书存储在 Keychain 环中,但 python.org python 不查询 Keychain 环。 See http://bugs.python.org/issue17128http://bugs.python.org/issue17128

OK, I fixed this by setting the environment variable PYTHONHTTPSVERIFY to 0好的,我通过将环境变量 PYTHONHTTPSVERIFY 设置为 0 来解决这个问题

export PYTHONHTTPSVERIFY=0导出 PYTHONHTTPSVERIFY=0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android repo init:SSL_CERTIFICATE_VERIFY_FAILED 错误 - Android repo init : SSL_CERTIFICATE_VERIFY_FAILED error 在 2021 年 9 月 30 日之后使用 LetsEncrypt SSL 证书在 Android 7 CERTIFICATE_VERIFY_FAILED 上颤动 - Flutter on Android 7 CERTIFICATE_VERIFY_FAILED with LetsEncrypt SSL cert after Sept 30, 2021 Flutter on android CERTIFICATE_VERIFY_FAILED:证书已过期 - Flutter on android CERTIFICATE_VERIFY_FAILED: certificate has expired Flutter - CERTIFICATE_VERIFY_FAILED - Flutter - CERTIFICATE_VERIFY_FAILED CERTIFICATE_VERIFY_FAILED:所有 flutter 应用程序的证书已过期 - CERTIFICATE_VERIFY_FAILED: certificate has expired on all flutter apps android volley 验证 ssl 证书 - android volley verify ssl certificate CERTIFICATE_VERIFY_FAILED:无效或不一致的证书扩展名(handshake.cc.359) - CERTIFICATE_VERIFY_FAILED: invalid or inconsistent certificate extension(handshake.cc.359) 通过 boost 验证 android 中的证书失败 - Verify certificate in android by boost failed 如何在Android应用程序中验证SSL证书的有效性 - how to verify the validity of SSL certificate in an Android application DioError HandshakeException:客户端握手错误(操作系统错误:CERTIFICATE_VERIFY_FAILED:证书已过期(handshake.cc:393)) - DioError HandshakeException: Handshake error in client (OS Error: CERTIFICATE_VERIFY_FAILED: certificate has expired(handshake.cc:393))
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM