3

更新2018-02-26

ssh工作了。

我仍然很想知道为什么https通话失败。


关于在哪里查看以允许通过 https 克隆的任何帮助?(不能使用 ssh,端口被阻塞)

操作系统

Windows Server 2012 R2 标准版

安装位置

C:\程序文件\Git

命令

$ git clone -b <branch_name> https://<PAT>@<company>.visualstudio.com/... <directory>
Cloning into '<directory>'...
fatal: unable to access 'https://<company>.visualstudio.com/...': error setting certificate verify locations:
  CAfile: /mingw64/ssl/certs/ca-bundle.crt
  CApath: none

我可以cat从 Git bash 获得证书

cat /mingw64/ssl/certs/ca-bundle.crt

混帐配置

$ git config --list
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
rebase.autosquash=true
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
http.sslbackend=openssl
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
credential.helper=manager

~/.gitconfig存在文件

尝试使用git -c http.sslVerify=false clone ...仍然失败:(我知道这不安全)

fatal: unable to access 'https://<PAT>@<company>.visualstudio.com/...': error setting certificate verify locations:
  CAfile: /mingw64/ssl/certs/ca-bundle.crt
  CApath: none

看起来它还在尝试读取证书?!

所有命令都在 Git Bash 中运行,无论有无管理权限,结果都不会改变。用户是提升的服务帐户。相同的配置和安装适用于相同操作系统的测试服务器和安装位置。

4

3 回答 3

1

当我错误地将 http 代理设置为 https 地址时,我得到了完全相同的错误。您可以通过运行来检查它git config --list

我有这样的条目:

http.proxy=https://myproxy.com:8080

代替:

http.proxy=http://myproxy.com:8080
于 2018-03-14T10:15:58.770 回答
0

在 Git-2.16.2-64-bit 上遇到了这个问题

降级到 Git-2.15.0-64 位

问题消失了。


于 2018-04-17T14:24:52.913 回答
0

我曾经遇到过同样的问题

首先我建议你重新安装你的 GIT 客户端。这可能会解决您的问题,但是如果您在卸载每个临时/配置文件时不小心删除它,也可能会导致其他问题。

重新安装后,我的 GIT 将不再工作:

以下来自这个答案:重新安装git for windows后出现此问题。我在 Windows 10 上将 git 用于 Windows 64 位。

我发现安装程序不再在C:/Users/[USER_NAME]/AppData/Local/Programs/Git. 相反,它将它安装在 C:\Program Files\Git.

C:\ProgramData\Git\config尽管如此,安装程序并未编辑旧的配置文件。该文件仍然包含旧路径,因此我手动对其进行了编辑。

例如在我使用的系统上

[http]
     sslCAInfo = C:/Programme/Git/mingw64/ssl/certs/ca-bundle.crt

也许你将不得不Program Files使用

     sslCAInfo = C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
于 2018-02-19T10:19:52.003 回答