Android repo init:SSL_CERTIFICATE_VERIFY_FAILED错误

问题描述 投票:0回答:1

下载Android源代码:

我正在发行

repo init -u https://android.googlesource.com/platform/manifest

但我收到以下错误:

fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [SSL_CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c :726)
fatal: cloning the git-repo repository,will remove '.repo/repo'

我试过了什么?

- 我试过从谷歌浏览器和互联网浏览器访问https://android.googlesource.com/platform/manifesthttps://gerrit.googlesource.com/git-repo/clone.bundle,没有问题

- 在repo init命令中将https更改为http

- 修改了repo脚本并将https更改为http

- 修改gitconfig如下:

[user]
        name = myName
        email = myemail.id
[http]
        proxy = http://user:[email protected]:8080
        sslVerify = false
[https]
        proxy = https://user:[email protected]:8080
        sslVerify = false

如何导入这些网站的证书?我使用的是Ubuntu 18.04。有没有办法强制忽略这个?

PS:我在代理后面,已经设置了代理设置,它工作正常。(尝试过sudo apt-get update)

android ssl android-build repo
1个回答
0
投票

好的,我通过将环境变量PYTHONHTTPSVERIFY设置为0来解决此问题

export PYTHONHTTPSVERIFY=0

Python, since v2.7.9, will by default now check the SSL certificates. To revert to the correct behavior for the repo script, set up an environment variable PYTHONHTTPSVERIFY=0.
This will shut off all certificate verification.

repo脚本现在应该按照宣传的方式运行。

© www.soinside.com 2019 - 2024. All rights reserved.