公司网络上的 git SSL 问题



我正在尝试从Bitbucket签出我的git存储库。我做了结帐,但这得到了这个:

pi@raspberrypi:~/Documents$ git clone https://user@bitbucket.org/user/project.git
Cloning into 'project'...
fatal: unable to access 'https://user@bitbucket.org/user/project.git/': SSL: certificate subject name (guestlogin.mycompany.com) does not match target host name 'bitbucket.org'

我在这里阅读了其他一些帖子,并在禁用SSL验证的情况下重试:

pi@raspberrypi:~/Documents$ git -c http.sslVerify=False clone https://user@bitbucket.org/user/project.git
Cloning into 'project'...
fatal: https://user@bitbucket.org/user/project.git/info/refs not valid: is this a git repository?

恐怕有些问题是我在企业网络后面。我能做些什么来解决这个问题吗?

编辑:让我感到困惑的是,如果我将手机连接到公司wifi,在手机上启用移动热点,然后将计算机(树莓派)连接到移动热点,克隆工作正常。但是,如果我将树莓派直接连接到公司网络 (PEAP),则会遇到 SSL 问题。

这肯定是由您和Bitbucket之间的代理服务器引起的。https://confluence.atlassian.com/bitbucketserverkb/can-t-clone-or-pull-due-to-a-git-outbound-proxy-779171769.html 的说明特别提到了Bitbucket服务器(自托管版本,而不是 bitbucket.org),但无论如何,代理说明都应该对您有用。如果他们不这样做,那么与贵公司的网络人员交谈,看看你们能想出什么。

如果您的公司网络允许,您也可以使用 SSH。不过,我强烈建议不要http.sslVerify=False - 它不仅向您展示了确切的问题(您正在访问内部代理服务器,但没有访问 Bitbucket),而且还保护您免受许多中间人攻击。

最新更新