33

We have Atlassian Stash installed on a Windows 2008R2 server, and for the most part everything is working nicely. We have an SSL certificate issued by our local on-premise CA and a DNS entry set up so we can go to https://stash/ and it works quite nicely, except in Firefox where it throws a warning (related?).

When using Atlassian's Sourcetree we can navigate and choose a repository, but when we try to clone it we get the following error:

fatal: unable to access https://user@url/scm/etc/etc.git: SSL certificate problem: unable to get local issuer certificate

I get the same error if I try if from the git bash as well. Based on this error, I've tried following the instructions on adding the SSL certificate to the Git as also found on their website, including what is in the comments, to no avail. I have exported the cert through Firefox and through the MMC certificate snap-in, gotten the same results and put it in its own file, combined with the curl file, and no matter what keep getting this error. I have yet to try getting it to work with SSH keys yet since I was hoping to make this easier for my team.

I also tried using ssh myserver and accepting the connection, and I entered my password and restarted; still the same error.

I do not want to simply ignore certificate validation either, since that seems a bit pointless, then.

How can I get this working with our CA-issued cert?

4

4 回答 4

76

我刚刚禁用了 SSL 证书检查(这对于内部回购很好):

Tools > Options > Git > Disable SSL certificate validation (ticked)
于 2015-08-27T01:37:57.110 回答
19

在与一个直到今天还在工作的同行合作之后,我发现我一直只使用服务器本身的证书。我对所有文章的 [错误] 理解是,类似于处理自签名证书,您只需告诉 Git 信任此证书。这对我们来说不是这样。

相反,我应该导出并告诉 Git 信任的是来自我们域的根 CA 证书。我发誓我上周早些时候在这一切刚开始的时候就试过了,但让我感到羞耻的是我一定没有。

让这成为任何发现自己处于我位置的人的警告!

于 2014-07-22T16:57:51.303 回答
0

您需要为您的服务使用完整的链证书,这不仅意味着您的证书,还意味着证书文件中的中间证书和根证书

于 2018-09-25T05:34:54.473 回答
0

Sourcetree > Preferences > Git 勾选“禁用 SSL 证书验证”:

如何使用 Sourcetree 禁用 SSL

于 2021-12-01T17:18:19.953 回答