【发布时间】:2017-07-04 23:03:25
【问题描述】:
我们在我们的服务器上使用内部证书,我已按照中的步骤进行操作
以及这里的步骤:
作为服务运行时出错:
git version
git config --get remote.origin.url
git config gc.auto 0
git config --get-all http.https://ourtfsserver:8443/tfs/path/_git/project.extraheader
git config --get-all http.proxy
git -c http.extraheader="AUTHORIZATION: bearer ********" fetch --tags --prune --progress origin
fatal: unable to access 'https://ourtfsserver:8443/tfs/path/_git/project/': SSL certificate problem: unable to get local issuer certificate
##[error]Git fetch failed with exit code: 128
当使用相同的代理配置但使用 .\run.cmd 而不是作为服务(相同的凭据)运行时,它可以成功运行:
git version
git config --get remote.origin.url
git config gc.auto 0
git config --get-all http.https://ourtfsserver:8443/tfs/path/_git/project.extraheader
git config --get-all http.proxy
git -c http.extraheader="AUTHORIZATION: bearer ********" fetch --tags --prune --progress origin
git checkout --progress --force {hash here}
(and continues onto next steps)
但是,当我尝试使用我们的构建代理帐户手动运行它时,它会提供与上面相同的Git fetch failed with exit code: 128。不过,我可以使用这些凭据手动git clone。
所以我试过了:
git config –global http.sslVerify false
以及手动设置配置文件以包含该变量。
我还使用 IE 安装了证书,以便根据第二篇博文获取它。
我也可以使用git clone https://ourtfsserver:8443/tfs/path/_git/project c:\somefolder作为我的帐户和我们的构建代理帐户手动下拉项目而不会出现问题
我从 2017 年 2 月 13 日开始使用 TFS 2017 Update 1 RC2 (https://www.visualstudio.com/en-us/news/releasenotes/tfs2017-update1),以前的版本根本不允许我们的构建代理正确连接到 tfs https。我们的旧 TFS 2015 构建代理仍然有效,但缺少 v2 代理的新功能。
编辑:使用 set HTTP_PROXY=https://localhost:8888 我能够让 VSTS 使用 fiddler 作为代理,它提出了一个请求:
CONNECT our.local.tfs.fqdn:8443 HTTP/1.1
Host: our.local.tfs.fqdn:8443
User-Agent: git/2.10.0 (vsts-agent-git/2.112.0)
A SSLv3-compatible ClientHello handshake was found. Fiddler extracted the parameters below.
Version: 3.3 (TLS/1.2)
(bunch of other stuff it decrypted here)
对于 Auth 它有:
No Proxy-Authorization Header is present.
No Authorization Header is present.
【问题讨论】:
-
您是否按照链接中的步骤重新启动了构建服务?还有一个类似的问题:github.com/Microsoft/vsts-agent/issues/688
-
@Eddie-MSFT 是的,我已经重新启动了整个服务器几次试图让它工作:( 是的,我之前看到过那个链接并尝试做同样的事情,我也是以我的 OP 中的博客结束。我希望将 SSL_Verify 设置为 false 会起作用,因为它的内部我不太关心 SSL,我们只启用它,因为它是构建代理首先需要的使用 PAT 或其他身份验证类型。