Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to communicate with https servers #1493

Closed
1 task done
alexweej opened this issue Feb 12, 2018 · 14 comments
Closed
1 task done

Unable to communicate with https servers #1493

alexweej opened this issue Feb 12, 2018 · 14 comments
Assignees
Milestone

Comments

@alexweej
Copy link

alexweej commented Feb 12, 2018


NOTE: This was already reported in #1453 but that was closed due to a bit of a flame war. Let's try again :)

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?

64-bit

$ git --version --build-options

Sorry, already uninstalled, it was Git-2.16.1.4-64-bit.exe.

  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?

7, 64-bit.

$ cmd.exe /c ver
Microsoft Windows [Version 6.1.7601]
  • What options did you set as part of the installation? Or did you choose the
    defaults?

All defaults, apart from VS Code as the text editor.

# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Sorry, already uninstalled, can repro if needed but fairly disruptive to my work.
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

MITM https proxy

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Bash

git clone
git fetch
git push
etc.
  • What did you expect to occur after running these commands?

works

  • What actually happened instead?
stderr: Cloning into 'C:\Users\THEPATH'...
fatal: unable to access 'https://THEREPO/url/': error setting certificate verify locations:
  CAfile: /mingw64/ssl/certs/ca-bundle.crt
  CApath: none
  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

Private Git server.


Thanks!

@dscho
Copy link
Member

dscho commented Feb 13, 2018

This was already reported in #1453 but that was closed due to a bit of a flame war. Let's try again :)

Thank you for giving this bug another chance of getting resolved.

Sorry, already uninstalled, can repro if needed but fairly disruptive to my work.

Can you reproduce with PortableGit (https://github.com/git-for-windows/git/releases/download/v2.16.1.windows.4/PortableGit-2.16.1.4-64-bit.7z.exe)? That would be the least disruptive to your work.

Also, as before: What does git config --show-origin http.sslCAInfo say?

Note: If you are willing to test a couple of things, I am willing to put in the hours to build custom installers to get to the bottom of this.

And of course I can give you a pretty easy way to work around the issue in your daily work: set the environment variable GIT_SSL_CAINFO to the absolute path C:\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt (or wherever your file actually lives).

@alexweej
Copy link
Author

Thanks, I'll try to get someone from my org to follow up ASAP, else I'll come back to this shortly.

Btw RE the ca-bundle.crt path, I don't believe this was ever manually configured. It was always just the default location installed by Git-for-Windows... Is it normal for people to customize this? I didn't see any installation option for it...

Thanks

Alex

@dscho
Copy link
Member

dscho commented Feb 14, 2018

Btw RE the ca-bundle.crt path, I don't believe this was ever manually configured. It was always just the default location installed by Git-for-Windows... Is it normal for people to customize this? I didn't see any installation option for it...

It should not be manually configured, except when someone adds custom certificates e.g. to support servers with self-signed certificates.

@abtOliver
Copy link

abtOliver commented Feb 22, 2018

I have the same problem on a Windows 10 machine while on another it works without problems.
I tried it on both machines with Git-2.16.2-64-bit and the predessor Git-2.16.1-64-bit, the outcome is the same on the failing machine: unable to access...

Rolling back to Git-2.14.1-64-bit and everything seems working as expected.

The difference between both Windows 10 machines is, the failing one is located behind a corporate firewall and needs to be connected via proxy servers, no other internet access is possible.

@dscho
Copy link
Member

dscho commented Feb 22, 2018

@abtOliver are you sure that you see the exact same error message, including "CAfile: /mingw64/ssl/certs/ca-bundle.crt"?

And: does it work with http.proxy set?

@abtOliver
Copy link

@dscho this is the output from a clone command:

$ git clone "https://github.com/abtOliver/GitSmartPHP.git"
Cloning into 'GitSmartPHP'...
fatal: unable to access 'https://github.com/abtOliver/GitSmartPHP.git/': error setting certificate verify locations:
CAfile: /mingw64/ssl/certs/ca-bundle.crt
CApath: none

As you can see it is including the CAfile part.

The http.proxy contains something like this:

$ git config --get-all http.proxy
https://:@proxy01.company.com:8082/
https://:@proxy02.company.com:8082/
https://:@proxy03.company.com:8082/
https://:@proxy04.company.com:8082/
https://:@proxy05.company.com:8082/
https://:@proxy06.company.com:8082/

@abtOliver
Copy link

@dscho I found out something very interesting,
If you set http.sslcainfo to another value, the error message still persists with the default CAfile part:

$ git config --global http.sslcainfo "C:\Program Files\Git\mingw64\ssl\certs\somethingElse.crt"

$ git clone "https://github.com/abtOliver/GitSmartPHP.git"
Cloning into 'GitSmartPHP'...
fatal: unable to access 'https://github.com/abtOliver/GitSmartPHP.git/': error setting certificate verify locations:
CAfile: /mingw64/ssl/certs/ca-bundle.crt
CApath: none

@dscho
Copy link
Member

dscho commented Feb 23, 2018

Hmm. @abtOliver so the problem might be due to HTTPS proxies not using the correct CA file... I hope to find some time to set something up next week. If you have pointers (or even better, if you find an easy way to configure Apache2 to server as such an HTTPS proxy), I would be most grateful.

@whoisj
Copy link

whoisj commented Feb 24, 2018

@abtOliver have you tried using the new SChannel support and adding the certificates to your Windows store, instead of relying on http.sslcainfo?

@dscho
Copy link
Member

dscho commented Mar 4, 2018

/remind me in 10 days that I wanted to try to test this.

@reminders reminders bot added the reminder label Mar 4, 2018
@reminders
Copy link

reminders bot commented Mar 4, 2018

@dscho set a reminder for Mar 14th 2018

@reminders reminders bot removed the reminder label Mar 14, 2018
@reminders
Copy link

reminders bot commented Mar 14, 2018

👋 @dscho, I wanted to try to test this.

@dscho
Copy link
Member

dscho commented Mar 22, 2018

A new snapshot should be available at https://wingit.blob.core.windows.net/files/index.html soon; please test!

@dscho
Copy link
Member

dscho commented Mar 23, 2018

@abtOliver could you test this, please?

@dscho dscho added this to the v2.16.2(2) milestone Mar 23, 2018
dscho added a commit to dscho/MINGW-packages that referenced this issue Apr 12, 2018
There are actually two separate settings for the ca-bundle.crt file: one
to validate HTTPS servers, and one to validate HTTPS proxies. We forgot
the proxies.

This is a port of the fix for
git-for-windows/git#1493

Signed-off-by: Johannes Schindelin <[email protected]>
Alexpux pushed a commit to msys2/MINGW-packages that referenced this issue Apr 12, 2018
…rtificates of proxies (#3592)

* curl: ensure that the correct ca-bundle.crt is used for HTTPS proxies

There are actually two separate settings for the ca-bundle.crt file: one
to validate HTTPS servers, and one to validate HTTPS proxies. We forgot
the proxies.

This is a port of the fix for
git-for-windows/git#1493

Signed-off-by: Johannes Schindelin <[email protected]>

* curl: increase pkgrel

We just fixed the long-standing issue where cURL would not find the
certificate bundle when trying to validate HTTPS *proxies*'
certificates.

Let's increase the pkgrel in preparation for a new build.

Signed-off-by: Johannes Schindelin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants