[英]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/issue17128见http://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.