本文介绍了SSL证书拒绝尝试通过HTTPS访问防火墙后的GitHub的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我被卡在防火墙后面,所以必须使用HTTPS访问我的GitHub存储库。我在Windows XP上使用cygwin 1.7.7。 我尝试将遥控器设置为 https://[email protected] /username/ExcelANT.git ,但推送提示输入密码,但一旦我输入它不做任何事情。 https:// username:< password> github.com/username/ExcelANT.git ,并从头开始克隆空repo,相同的错误开启 GIT_CURL_VERBOSE = 1 给我 fatal:HTTP请求失败 这是我的防火墙,cygwin的问题? 我没有在Git配置中设置HTTP代理,但它是一个ISA服务器需要NTLM身份验证,而不是基本的,所以除非有人知道如何强制git 解决方案如果要修复证书问题,请随意跳过此答案。这个答案处理通过防火墙的隧道ssh是IMHO更好的解决方案处理防火墙/代理事物。 有一个比使用http访问更好的方法,以使用github在ssh.github.com服务器的端口443上提供的ssh服务。 我们使用一个叫做corkscrew的工具。这适用于CygWin(通过从cygwin主页设置)和Linux使用您最喜欢的打包工具。 命令行如下: $ corkscrew< proxyhost> < proxyport> < targethost> < targetport> < authfile> proxyhost和proxyport是https代理的坐标。 targethost和targetport是要隧道连接的主机的位置。 authfile是一个文本文件,其中包含用冒号分隔的代理服务器用户名/密码1行。 例如: abc:very_secret 使用正常ssh协议对于git通信 通过将此添加到〜/ .ssh / config 主机github.com HostName ssh.github.com 端口443 用户git ProxyCommand开瓶器< proxyhost> < proxyport> %h%p〜/ .ssh / proxy_auth 现在你可以通过sshing gitproxy pti @ pti-laptop:〜$ ssh github.com 通道0上的PTY分配请求失败 Hi ptillemans!您已成功通过身份验证,但GitHub不提供shell访问。 连接到github.com关闭。 pti @ pti-laptop:〜$ (注意:如果您从未登入github之前,ssh将要求将服务器密钥添加到已知的hosts文件。如果你是偏执的,建议验证RSA指纹到您上传您的密钥的github网站上显示的指纹)。 这种方法的一个小小的变体是当你需要访问一个仓库与另一个键的情况下,例如将您的私人帐户与专业帐户分开。 ##专用于ACME私人github帐户的帐户#主机acme。 github.com 用户git HostName ssh.github.com 端口443 ProxyCommand corkscrew< proxyhost> < 3128> %h%p〜/ .ssh / proxy_auth IdentityFile〜/ .ssh / id_dsa_acme 享受! 我们已经在Linux,Mac和Windows上使用了多年。 您希望您可以在本博文阅读更多内容 I'm stuck behind a firewall so have to use HTTPS to access my GitHub repository. I'm using cygwin 1.7.7 on Windows XP.I've tried setting the remote to https://[email protected]/username/ExcelANT.git, but pushing prompts for a password, but doesn't do anything once I've entered it.https://username:<password>github.com/username/ExcelANT.git and cloning the empty repo from scratch but each time it gives me the same errorTurning on GIT_CURL_VERBOSE=1 gives mefatal: HTTP request failedIs this a problem with my firewall, cygwin or what?I hadn't set the HTTP proxy in the Git config, however it's an ISA server that needs NTLM authentication, not basic, so unless anyone knows how to force git to use NTLM, I'm scuppered. 解决方案 Feel free to skip past this answer if you want to fix the certificates issue. This answer deals with tunneling ssh through the firewall which is IMHO a better solution to dealing with firewall/proxy thingies.There is a better way than using http access and that is to use the ssh service offered by github on port 443 of the ssh.github.com server.We use a tool called corkscrew. This is available for both CygWin (through setup from the cygwin homepage) and Linux using your favorite packaging tool. For MacOSX it is available from macports and brew at least.The commandline is as follows :$ corkscrew <proxyhost> <proxyport> <targethost> <targetport> <authfile>The proxyhost and proxyport are the coordinates of the https proxy. The targethost and targetport is the location of the host to tunnel to. The authfile is a textfile with 1 line containing your proxy server username/password separated by a colone.g:abc:very_secretInstallation for using "normal" ssh protocol for git communicationBy adding this to the ~/.ssh/config this trick can be used for normal ssh connections.Host github.com HostName ssh.github.com Port 443 User git ProxyCommand corkscrew <proxyhost> <proxyport> %h %p ~/.ssh/proxy_authnow you can test it works by ssh-ing to gitproxypti@pti-laptop:~$ ssh github.comPTY allocation request failed on channel 0Hi ptillemans! You've successfully authenticated, but GitHub does not provide shell access. Connection to github.com closed.pti@pti-laptop:~$(Note: if you never logged in to github before, ssh will be asking to add the server key to the known hosts file. If you are paranoid, it is recommended to verify the RSA fingerprint to the one shown on the github site where you uploaded your key).A slight variant on this method is the case when you need to access a repository with another key, e.g. to separate your private account from your professional account. ## account dedicated for the ACME private github account#Host acme.github.com User git HostName ssh.github.com Port 443 ProxyCommand corkscrew <proxyhost> <3128> %h %p ~/.ssh/proxy_auth IdentityFile ~/.ssh/id_dsa_acmeenjoy!We've been using this for years now on both Linux, Macs and Windows.If you want you can read more about it in this blog post 这篇关于SSL证书拒绝尝试通过HTTPS访问防火墙后的GitHub的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-06 17:29