Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git for Windows - clone over https failing

UPDATE 2018-02-26

Got ssh working instead.

I'd still be interested to know why the https call failed.


Any help on where to look next to allow cloning via https? (Cannot use ssh, port is blocked)

OS

Windows Server 2012 R2 Standard

Install location

C:\Program Files\Git

Command

$ 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

I can cat the certificate from Git bash

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

git config:

$ 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

No ~/.gitconfig file exists

Trying to use git -c http.sslVerify=false clone ... still fails: (I'm aware this is not secure)

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

Looks like it is still trying to read the certificate?!

Commands all run in Git Bash, both with and without administrative privileges, without change in outcome. The user is an elevated service account. The same configuration and install works on a test server of the same OS, and install location.

like image 525
Adrian Torrie Avatar asked May 08 '26 07:05

Adrian Torrie


1 Answers

I got exactly same error when I incorrectly set http proxy to https address. You can check it by running git config --list.

I had there entry like:

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

instead of:

http.proxy=http://myproxy.com:8080
like image 69
Dawid Pytel Avatar answered May 10 '26 22:05

Dawid Pytel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!