You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Provide a better error message for schannel errors #3326
I played a little bit with git sslBackend settings and directly with curl 7.57.0 including SChannel support.
If you have a corporate proxy intercepting your traffic with a custom cert (MITM proxy) or you are intercepting your own traffic with a local proxy like Fiddler, all SSL revocation checks will fail (curl/curl#264 (comment)). This results in the error:
next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate
There are two solutions: The first would be using openssl as SSL backend (I guess openSSL isn't doing revocation checks at all), but this requires that you configure sslCAInfo.
Another option (and IMO preferable) would be to configure libcurl to disable revocation checks:
If you are unable to find the cause and your circumstances allow you can
disable revocation checking per session in curl w/ WinSSL by using
option --ssl-no-revoke [1] in curl >= 7.44 or by passing flag
CURLSSLOPT_NO_REVOKE to CURLOPT_SSL_OPTIONS [2] in libcurl >= 7.44.
However, it looks like this option is not yet available in git. So maybe this should be reported upstream to Git for Windows? Others have added this option, too. E.g. cargo (rust-lang/cargo#2464).
BTW, there is the GIT_CURL_VERBOSE environment variable, which might be really helpful to debug these issues.
However, it looks like this option is not yet available in git. So maybe this should be reported upstream to Git for Windows? Others have added this option, too. E.g. cargo (rust-lang/cargo#2464).
This is probably where we need to head with this. If you don't open an issue to start the discussion about this in Git for Windows before the new year then I can do it.
Was there an upstream issue created? This one comes fairly early in the google search, so it would be useful if it could forward through to where the problem is really going to be resolved.
In my case, I was originally getting:
$ git clone https://git.server/git/main.git
Cloning into 'main'...
fatal: unable to access 'https://git.server/git/main.git/': schannel: next InitializeSecurityContext failed: SEC_E_UNTRUSTED_ROOT (0x80090325) - The certificate chain was issued by an authority that is not trusted.
I installed the certificate in the windows trusted store, and then got this message:
$ git clone https://git.server/git/main.git
Cloning into 'main'...
fatal: unable to access 'https://git.server/git/main.git/': schannel: next InitializeSecurityContext failed: Unknown error (0x80092013) - The revocation function was unable to check revocation because the revocation server was offline.
Based on what I read above, I would really like to be able to turn off revocation checking, so being able to set that option would be useful :-)
The problem with this backend is that you're back to managing your certificates again, but if you need to provide your own certificates I'd recommend starting with this PEM file of public certificates and concatenating them (this thread has some important tips).
Reacted by Yervand Baghdasaryan and InfluencerNGZK
I'd recommend switching yourself over to the OpenSSL backend, as that doesn't seem to trigger this issue.
$ git config --local http.sslBackend "openssl"
$ git config --local http.sslCAInfo [path to .pem file]
I tried the above settings but still run into the same error.
I also tried setting it to the certs subfolder under ssl, as well as the one under C:\Program Files\Git\usr\ssl
I've tried uninstalling/reinstalling many times since this issue surfaced, tried with OpenSSL and native Secure channel options, everything leads to one of the below errors for me.
OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 schannel: failed to receive handshake, SSL/TLS connection failed
Even the git config --global http.sslVerify false setting doesn't work for me with either of the above options. This was working without any problems on Windows 7 out of the box.
Hi, I am, in part, responsible for deploying git internally at our company. We can use the workaround mentioned but want to avoid defining the proxy for every user (aka injecting clear text username / passowrd into disk esp with corp password policy requiring frequent changes).
Schannel works well for internal git servers it seems (we have an internal gitlab server). It only fails when using git for external uses (gitlab / github tested, noticed when installing go...). I have a supposition that this is because whatever appliance they use doesn't create an internal CRL / CDP for the certificates (which makes some sense as they are deployed on the fly, seemingly).
I would wager that this error is indeed related to not having a CDP configured. This might be a poor assumption of schannel libraries or it could be a git bug caused by the same assumption - that a cdp exists.
If anyone wants to reach out to me to perform some testing I might be able to assist.
@jd-mtb stay tuned for the next Git for Windows update (2.18.1) as it will have the ability to disable certificate revocation checks using git config http.schannelCheckRevoke
http.schannelCheckRevoke::
Used to enforce or disable certificate revocation checks in cURL
when http.sslBackend is set to "schannel". Defaults to `true` if
unset. Only necessary to disable this if Git consistently errors
and the message is about checking the revocation status of a
certificate. This option is ignored if cURL lacks support for
setting the relevant SSL option at runtime.
I'll be looking at improving the messaging in Desktop to set this flag (if the user consents) once we've upgraded our embedded Git. Then you won't need to revert to the OpenSSL backend.
@shiftkey
Thanks, I think this is 'ok' for my needs and perfectly fine for my environment. I feel like a more ideal setting for the project might be to check CRL when available, but to not if it is not available on the certificate. That might just be me being a begging chooser though and even in my case, this only manifests externally when git is hitting the proxy cert and checking is rather moot.
In any case, thanks for the heads up! I will be sure to take advantage of this upon release.
I downloaded the cacert.pem as linked to in the workaround. And ran the commands trough git with no problems.
However, now I get this instead: fatal: unable to access 'https://github.com/Norway174/Peanut-DiscordBot.git/': SSL certificate problem: self signed certificate in certificate chain
I should also note, I'm on a personal home system. So why I even got it to begin with, is a bit weird.
And the old GitHub for Desktop works perfectly fine.
@Norway174 are you using any sort of proxy server in between your machine and GitHub? That message often happens when something tries to use a different certificate but the machine doesn't trust it.
@Norway174 I don't know which OS and browser setup you are on, but that can affect how they check and verify certificates.
But you can view the certificate chain using OpenSSL and this command:
$ openssl s_client -host github.com -port 443
You should see a chain like this at the start of the output:
CONNECTED(00000006)
depth=1 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert SHA2 Extended Validation Server CA
verify error:num=20:unable to get local issuer certificate
verify return:0
---
Certificate chain
0 s:/businessCategory=Private Organization/1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=Delaware/serialNumber=5157550/C=US/ST=California/L=San Francisco/O=GitHub, Inc./CN=github.com
i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA
1 s:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA
i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA
---
Server certificate
-----BEGIN CERTIFICATE-----
...
Activity
j-f1 commentedon Dec 4, 2017
Also #3498.
schlamar commentedon Dec 15, 2017
I played a little bit with git sslBackend settings and directly with curl 7.57.0 including SChannel support.
If you have a corporate proxy intercepting your traffic with a custom cert (MITM proxy) or you are intercepting your own traffic with a local proxy like Fiddler, all SSL revocation checks will fail (curl/curl#264 (comment)). This results in the error:
There are two solutions: The first would be using openssl as SSL backend (I guess openSSL isn't doing revocation checks at all), but this requires that you configure sslCAInfo.
Another option (and IMO preferable) would be to configure libcurl to disable revocation checks:
source
However, it looks like this option is not yet available in git. So maybe this should be reported upstream to Git for Windows? Others have added this option, too. E.g. cargo (rust-lang/cargo#2464).
BTW, there is the GIT_CURL_VERBOSE environment variable, which might be really helpful to debug these issues.
shiftkey commentedon Dec 27, 2017
This is probably where we need to head with this. If you don't open an issue to start the discussion about this in Git for Windows before the new year then I can do it.
pwagland commentedon Jan 21, 2018
Was there an upstream issue created? This one comes fairly early in the google search, so it would be useful if it could forward through to where the problem is really going to be resolved.
In my case, I was originally getting:
I installed the certificate in the windows trusted store, and then got this message:
Based on what I read above, I would really like to be able to turn off revocation checking, so being able to set that option would be useful :-)
shiftkey commentedon Jan 21, 2018
I'd recommend switching yourself over to the OpenSSL backend, as that doesn't seem to trigger this issue.
The problem with this backend is that you're back to managing your certificates again, but if you need to provide your own certificates I'd recommend starting with this PEM file of public certificates and concatenating them (this thread has some important tips).
shiftkey commentedon Jan 21, 2018
@pwagland @schlamar I've opened up an issue here to get interest in it: git-for-windows/git#1446
sgthomas-github commentedon Jun 13, 2018
I tried the above settings but still run into the same error.
shiftkey commentedon Jun 13, 2018
@sgthomas-github please ensure that you've used a valid path to a PEM file, as
[path to .pem file]is only supposed to be a placeholder.sgthomas-github commentedon Jun 13, 2018
Yes, indeed, I had the following instead.
$ git config --global http.sslBackend "openssl"$ git config --global http.sslCAInfo "C:\Program Files\Git\mingw64\ssl\cert.pem"When that didn't work, I tried also just providing the folder path (for the second setting)
$ git config --global http.sslCAInfo "C:\Program Files\Git\mingw64\ssl"I also tried setting it to the
certssubfolder underssl, as well as the one underC:\Program Files\Git\usr\sslI've tried uninstalling/reinstalling many times since this issue surfaced, tried with OpenSSL and native Secure channel options, everything leads to one of the below errors for me.
OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443schannel: failed to receive handshake, SSL/TLS connection failedEven the
git config --global http.sslVerify falsesetting doesn't work for me with either of the above options. This was working without any problems on Windows 7 out of the box.jd-mtb commentedon Aug 2, 2018
Hi, I am, in part, responsible for deploying git internally at our company. We can use the workaround mentioned but want to avoid defining the proxy for every user (aka injecting clear text username / passowrd into disk esp with corp password policy requiring frequent changes).
Schannel works well for internal git servers it seems (we have an internal gitlab server). It only fails when using git for external uses (gitlab / github tested, noticed when installing go...). I have a supposition that this is because whatever appliance they use doesn't create an internal CRL / CDP for the certificates (which makes some sense as they are deployed on the fly, seemingly).
I would wager that this error is indeed related to not having a CDP configured. This might be a poor assumption of schannel libraries or it could be a git bug caused by the same assumption - that a cdp exists.
If anyone wants to reach out to me to perform some testing I might be able to assist.
I am using git for windows 18.0 windows 7.
Thanks, Josh
shiftkey commentedon Aug 7, 2018
@jd-mtb stay tuned for the next Git for Windows update (2.18.1) as it will have the ability to disable certificate revocation checks using
git config http.schannelCheckRevokehttps://github.com/dscho/git/blob/6152657e1a97c478df97d633c47469043b397519/Documentation/config.txt#L2127-L2133
I'll be looking at improving the messaging in Desktop to set this flag (if the user consents) once we've upgraded our embedded Git. Then you won't need to revert to the OpenSSL backend.
jd-mtb commentedon Aug 7, 2018
@shiftkey
Thanks, I think this is 'ok' for my needs and perfectly fine for my environment. I feel like a more ideal setting for the project might be to check CRL when available, but to not if it is not available on the certificate. That might just be me being a begging chooser though and even in my case, this only manifests externally when git is hitting the proxy cert and checking is rather moot.
In any case, thanks for the heads up! I will be sure to take advantage of this upon release.
shiftkey commentedon Aug 7, 2018
If you feel strongly about it you should ask on the upstream project: https://github.com/git-for-windows/git
jd-mtb commentedon Aug 7, 2018
Thanks, I totally thought I was under the git-for-windows repository, I was at some point but must have selected the wrong tab and never noticed :).
Thanks again!!
Norway174 commentedon Sep 8, 2018
I downloaded the cacert.pem as linked to in the workaround. And ran the commands trough git with no problems.
However, now I get this instead:
fatal: unable to access 'https://github.com/Norway174/Peanut-DiscordBot.git/': SSL certificate problem: self signed certificate in certificate chainI should also note, I'm on a personal home system. So why I even got it to begin with, is a bit weird.
And the old GitHub for Desktop works perfectly fine.
shiftkey commentedon Sep 13, 2018
@Norway174 are you using any sort of proxy server in between your machine and GitHub? That message often happens when something tries to use a different certificate but the machine doesn't trust it.
Norway174 commentedon Sep 13, 2018
@shiftkey Nope, shouldn't be. I'm connected to http://github.com just fine in my browser.
But is there a way to check, just in case?
shiftkey commentedon Sep 13, 2018
@Norway174 I don't know which OS and browser setup you are on, but that can affect how they check and verify certificates.
But you can view the certificate chain using OpenSSL and this command:
You should see a chain like this at the start of the output:
Norway174 commentedon Sep 13, 2018
@shiftkey Looks like it's my Kaspersky Anti-Virus. Never had a problem with it before. ¯\(ツ)/¯
And I'm on Win10, and using Opera as my browser.
shiftkey commentedon Sep 13, 2018
Check out #4738 and https://github.community/t5/How-to-use-Git-and-GitHub/Getting-quot-SSL-certificate-problem-self-signed-certificate-in/td-p/7531/page/3 for more details. Kasperksy might be registering itself in the Windows Certificate Store, but if you've switched to using the OpenSSL backend that uses the
cacert.pembundle you just obtained - and so it won't exist.Norway174 commentedon Sep 13, 2018
@shiftkey Thanks, I turned off Encrypted connections scanning. And it works now.
I wasn't able to find a way to add it to the exclusions, so it still works. But I'll keep looking into it. Thanks!
billygriffin commentedon Feb 25, 2020
Related to #8748 and #2789, and we're looking at this in the context of those.
vishnupriyaaTR commentedon Jun 24, 2021
This worked for me.