无论是使用Android Studio中,VCS >> Git >> Clone, 还是直接Git Clone命令,clone GitHub项目时,出现错误提示:LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
![Git操作GitHub时的Proxy配置 Git操作GitHub时的Proxy配置](https://image.shishitao.com:8440/aHR0cHM6Ly9pbWcyMDE4LmNuYmxvZ3MuY29tL2Jsb2cvNDI2ODAyLzIwMTgxMi80MjY4MDItMjAxODEyMTkyMTIwNDkzMzItOTE4OTY0OTA4LnBuZw%3D%3D.png?w=700)
但此时,电脑访问网络已经通过**,可以正常访问GitHub等资源。
*配置如下:
![Git操作GitHub时的Proxy配置 Git操作GitHub时的Proxy配置](https://image.shishitao.com:8440/aHR0cHM6Ly9pbWcyMDE4LmNuYmxvZ3MuY29tL2Jsb2cvNDI2ODAyLzIwMTgxMi80MjY4MDItMjAxODEyMTkyMTIxMzUyODUtMTg5MzYwNjkyNS5wbmc%3D.png?w=700)
Android Studio中,Preferences >> HTTP Proxy中,如下图配置完,重新Clone GitHub项目,依然出现同样的错误提示,这应该是Android Studio中的一个bug。
![Git操作GitHub时的Proxy配置 Git操作GitHub时的Proxy配置](https://image.shishitao.com:8440/aHR0cHM6Ly9pbWcyMDE4LmNuYmxvZ3MuY29tL2Jsb2cvNDI2ODAyLzIwMTgxMi80MjY4MDItMjAxODEyMTkyMTIxMTkyMDEtMTYxODMzNjIxMy5wbmc%3D.png?w=700)
解决方案:
git config --global http.proxy 'socks5://127.0.0.1:1086' git config --global https.proxy 'socks5://127.0.0.1:1086'
git config --global --list 显示git config global配置信息。
再次git clone xxx 即可。
如需要对应还原git proxy,可以使用命令:
git config --global --unset http.proxy git config --global --unset https.proxy
git proxy如果需要设置账号密码及端口。具体配置如下:
git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:port