Android repo初始化:SSL\u证书\u验证\u失败错误

Android repo初始化:SSL\u证书\u验证\u失败错误,android,ssl,android-build,repo,Android,Ssl,Android Build,Repo,下载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)

下载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'
我试过什么?

-我曾尝试访问谷歌浏览器和internet explorer,但没有任何问题

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

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

-修改gitconfig如下:

[user]
        name = myName
        email = myemail.id
[http]
        proxy = http://user:passwd@gateway.com:8080
        sslVerify = false
[https]
        proxy = https://user:passwd@gateway.com:8080
        sslVerify = false
如何导入这些站点的证书? 我正在使用Ubuntu 18.04。 有没有办法强迫你忽略这一点


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

好的,我通过将环境变量PYTHONHTTPSVERIFY设置为0修复了这个问题

导出PYTHONHTTPSVERIFY=0
repo脚本现在应该按照公布的方式运行。

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

导出PYTHONHTTPSVERIFY=0 回购脚本现在应该按照广告运行。

我是MAC用户(Mojave)。我也有同样的错误

当我启动时:

repo init <repository url>
这个问题似乎是由于MacOS上的Python3.6自带了自己的OpenSSL私有副本。这意味着Python ssl模块不再将系统中的信任证书用作默认值。要解决这个问题,您需要在系统中安装一个certifi软件包

解决方法:

open /Applications/Python\ 3.6/Install\ Certificates.command
我是MAC用户(莫哈韦)。我也有同样的错误

当我启动时:

repo init <repository url>
这个问题似乎是由于MacOS上的Python3.6自带了自己的OpenSSL私有副本。这意味着Python ssl模块不再将系统中的信任证书用作默认值。要解决这个问题,您需要在系统中安装一个certifi软件包

解决方法:

open /Applications/Python\ 3.6/Install\ Certificates.command

我花了3个小时在这个话题上,终于发现这些命令对我有用

我的Python 3是Python 3.6.9,Python是运行在Ubuntu 18.04上的Python 2.7.17

sudo apt-get install git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig
sudo apt-get install openjdk-8-jdk android-tools-adb bc bison build-essential curl flex g++-multilib gcc-multilib gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-gtk3-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc yasm zip zlib1g-dev git-core python3.8 libncurses5
sudo apt-get install ca-certificates
sudo update-ca-certificates --fresh
sudo update-alternatives --install /bin/python python /usr/bin/python3 1
sudo update-alternatives --install /bin/python python /usr/bin/python3.8 2
sudo update-alternatives --config python //choose 2
mkdir ~/bin
PATH=~/bin:$PATH
curl -k https://storage.googleapis.com/git-repo-downloads/repo-1 > ~/bin/repo
chmod a+x repo 
git config http.sslVerify false
export PYTHONHTTPSVERIFY=0
git config --global user.name "xxx"
git config --global user.name "xxx@xxx.com"
mkdir ./workspace
cd workspace
which repo
repo init -u https://android.googlesource.com/platform/manifest -b master
repo sync -j2

希望我的分享能对你有所帮助:)

我花了3个小时讨论这个话题,终于发现这些命令对我有用

我的Python 3是Python 3.6.9,Python是运行在Ubuntu 18.04上的Python 2.7.17

sudo apt-get install git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig
sudo apt-get install openjdk-8-jdk android-tools-adb bc bison build-essential curl flex g++-multilib gcc-multilib gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-gtk3-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc yasm zip zlib1g-dev git-core python3.8 libncurses5
sudo apt-get install ca-certificates
sudo update-ca-certificates --fresh
sudo update-alternatives --install /bin/python python /usr/bin/python3 1
sudo update-alternatives --install /bin/python python /usr/bin/python3.8 2
sudo update-alternatives --config python //choose 2
mkdir ~/bin
PATH=~/bin:$PATH
curl -k https://storage.googleapis.com/git-repo-downloads/repo-1 > ~/bin/repo
chmod a+x repo 
git config http.sslVerify false
export PYTHONHTTPSVERIFY=0
git config --global user.name "xxx"
git config --global user.name "xxx@xxx.com"
mkdir ./workspace
cd workspace
which repo
repo init -u https://android.googlesource.com/platform/manifest -b master
repo sync -j2
希望我的分享能帮助你:)