We are using an internal certificate on our server and I've followed the steps in
as well as the steps here:
Error when running as a service:
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
When running with the same agent config but using .\run.cmd instead of as a service (same credentials) it works successfully:
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)
However, when I try to run it manually using our build agent account it gives the same Git fetch failed with exit code: 128
as above. I can manually git clone
using these credentials though.
So I've tried:
git config –global http.sslVerify false
as well as manually setting the config file to include that variable.
I've also installed the certificate using IE to get it per the 2nd blog post.
I can manually pull down the project without issue as well, both as my account and our build agent account using git clone https://ourtfsserver:8443/tfs/path/_git/project c:\somefolder
I'm using the TFS 2017 Update 1 RC2 From Feb 13th 2017 (https://www.visualstudio.com/en-us/news/releasenotes/tfs2017-update1), the previous version wouldn't let our build agent connect at all to tfs https properly. Our old TFS 2015 build agent still works, but is missing the new features from the v2 agents.
Edit: Using set HTTP_PROXY=https://localhost:8888
I was able to get VSTS to use fiddler as a proxy and it made one request:
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)
for Auth it had:
No Proxy-Authorization Header is present.
No Authorization Header is present.