-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
CERT_TRUST_REVOCATION_STATUS_UNKNOWN with Git 2.41.0.windows.1 #4467
Comments
Does it work when setting the config option |
No, unfortunately not. I tried
as well as
But the result was the same |
Hey @dscho, your suggestion for this git option leaded me to the more relevant discussions for my case. Git works again if I do
Has the latest Git version switched from Thanks |
Indeed it has! I guess this release note entry did not talk about this explicitly, sorry... Now, Secure Channel is the native Windows component to do TLS/SSL, so it is much preferred to using OpenSSL. For example, if you want to access hosts with self-signed SSL certificates, using OpenSSL you have to jump through hoops. With Secure Channel, because it is integrated well into the Windows ecosystem, you simply need to direct your web browser to that host, accept the certificate, and then That is the reason why I would love to figure out what is going wrong here, so that you, too, can use Secure Channel. I see that there is a CA file in effect. Is |
Great, thanks for your effort @dscho
Yes indeed, we build a custom PEM file that contains the public certificates of Git as well as our company self-signed certificates. This PEM is used as trust store for Git and other tools. So I tried the following
Unfortunately I still get the same result.
|
Hmm. So it seems that the proxy connection worked, but then the revocation check fails? Is there maybe a chance that you can try the same command but bypassing the proxy? (And yes, I am clutching at straws.) |
Hi @dscho sorry for the delay, but I had to create a ticket to disable the SSL interception for my test URL So, new test setting. Still with proxy but without SSL interception. And this is already quite different. The repository is successfully cloned, but the verbse output of curl contains a lot of No idea if this is normal or a problem indicator. Settings
The result of the clone
Let me know if I should do some other tests in this setting or another test with proxy bypass. For the moment I stick with this setting because every change has to be done by ticket request. Thanks |
FYI: In our company, this change has caused CI pipelines using Gitlab Runner 16.1.0 to fail with the following error: "fatal: unable to access 'https://xxxx.git/': schannel: CertGetCertificateChain trust error CERT_TRUST_REVOCATION_STATUS_UNKNOWN." |
@sburkard I guess this is a clear indication that the proxy's causing the problem. Now, my hunch is that libcurl might need some changes to allow for the However, when I look at curl/curl@5450428 I do not see any red flags: Oh, but I just saw this: the @sburkard do you think you could test whether setting the proxy options helps? I.e.
These are all prefixed with "Info:", therefore I assume that they are not even warnings, just informative messages indicating that data arrived in such small chunks that decryption had to wait until more data arrived. |
As of v7.52.0, libcurl allows to specify not only the SSL options for the actual HTTPS connection, but also for the HTTPS proxy (if any). Let's do that. This _may_ address git-for-windows#4467. Signed-off-by: Johannes Schindelin <[email protected]>
FWIW I also opened a PR for that, you could therefore get going with a local test via these steps: sdk cd git
git fetch https://github.com/git-for-windows/git/ refs/pull/4495/head
git checkout FETCH_HEAD
make -j$(nproc) |
Hi @dscho OK, I've built the Git binary locally, checked out your branch and gave it a try. Unfortunately still the same problem. Official Git-Release + OpenSSL backend: works I can now "switch" between interception and no-interception since my GitHub-Repo is no more intercepted and any public non-GitHub-Repo is intercepted.
Let me know if I can do other tests to find the problem. Thanks |
Thank you for testing this. I fear the next steps might be a bit more involved: The most promising direction would be to build libcurl and instrument it with debug print statements. My suggestion to get there: $ sdk cd mingw-w64-curl
$ sdk build This will build the current |
Hi @dscho
Can I disable this check somehow? |
Hmm. That's strange, I never saw that before. That site's certificate is definitely verified by Let's Encrypt, so it is not really self-signed. IIRC |
Oh, maybe msys2/MSYS2-packages#2529 (comment) explains it... you're still behind that proxy, right? |
@sburkard https://www.msys2.org/docs/faq/#how-can-i-make-msys2pacman-trust-my-companys-custom-tls-ca-certificate should have a work-around for you. |
Yes, the selfsigned cert is from our proxy
Ah, it behaves like a standard linux truststore. Sorry that I didn't realize that before! |
Hi @dscho Well, that is really unexpected.
To my surprise, I got an error about self-signed cert in the chain with a hint to the truststore at
Nothing about schannel, it seemed to use the openssl trust material. So I explicitly set
Then, to my even bigger surprise, I got a successful repo clone (with the output of my This made me think about the changed default in Git 2.41.0, so I did the same on my standard Git installation
And then I crossed fingers and gave it a try. And IT WORKED
So long story short:
This conclusion is so damn simple that it's hard to believe. So I verified it on another machine to be sure that this is not a side effect of all my handicrafts around this issue 🙈
I still can't believe it. And by the way: it even works without |
@dscho We ran into the C:\builds\runners\windows.tmp>curl -v --cacert ./CI_SERVER_TLS_CA_FILE https://gitlab.redacteddomain/
* Trying 18.170.16.138:443...
* Connected to gitlab.redacteddomain (18.170.16.138) port 443 (#0)
* schannel: disabled automatic use of client certificate
* ALPN: offers http/1.1
* schannel: added 2 certificate(s) from CA file './CI_SERVER_TLS_CA_FILE'
* schannel: CertGetCertificateChain trust error CERT_TRUST_REVOCATION_STATUS_UNKNOWN
* Closing connection 0
* schannel: shutting down SSL/TLS connection with gitlab.redacteddomain port 443
curl: (60) schannel: CertGetCertificateChain trust error CERT_TRUST_REVOCATION_STATUS_UNKNOWN
More details here: https://curl.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above. Passing Can we enable
|
Git for Windows changed its SSL backend from OpenSSL to SChannel, but this breaks cloning for SSL certs that don't have a certificate revocation URL (git-for-windows/git#4467). For now, downgrade to v2.40.1 until that is resolved. Relates to: * https://gitlab.com/gitlab-org/gitlab-runner/-/issues/35848 * https://gitlab.com/gitlab-org/gitlab-runner/-/issues/35981 * https://gitlab.com/gitlab-org/gitlab-runner/-/issues/35994
@sburkard well, that is splendid news! About the new default: This will only matter if you install Git for Windows afresh. If you upgrade, it will use the previous settings (and ignore the new default).
@stanhu that's not a decision for Git for Windows to make, but for cURL. Please feel free to raise the issue in https://github.com/curl/curl/issues, preferably with the information you mentioned above to support this change. And with this addressed, I guess it is time to close this ticket 😃 |
I encountered this (and several other issues) with our self-signed certificates. With Git 2.39, the following configuration was working for us:
With Git 2.41, we had to change this to:
Without
Without
The presence of
|
I suspect that your implicit |
Thanks @dscho , yes, it does usually work with
With Git 2.39, the same clone works, so it's not only about the |
@mstrap thank you for clarifying. FWIW I also usually recommend Secure Channel instead of OpenSSL because it is integrated better with the Windows operating system. Speaking of which, why not go the common route and add the self-signed certificate(s) to the Windows Certificate Store? Like, if you direct your web browser to the host, add the certificate and trust it, using |
@dscho I have imported
When not importing
Maybe there is something wrong with our CA -- I'm not experienced with revocation lists. Either way, configuring everything in |
This is probably due to the fact that a self-signed certificate has no revocation URL (or at least no valid one). I had hoped that the default
Fair enough! |
Git for Windows changed its SSL backend from OpenSSL to SChannel, but this breaks cloning for SSL certs that don't have a certificate revocation URL (git-for-windows/git#4467). For now, downgrade to v2.40.1 until that is resolved. Relates to: * https://gitlab.com/gitlab-org/gitlab-runner/-/issues/35848 * https://gitlab.com/gitlab-org/gitlab-runner/-/issues/35981 * https://gitlab.com/gitlab-org/gitlab-runner/-/issues/35994
Setup
defaults?
to the issue you're seeing?
Behind enterprise proxy that intercepts HTTPS connections and self-signed certificates are used.
Details
Powershell/Git Bash
Minimal, Complete, and Verifiable example
this will help us understand the issue.
Cloned repository on my disk
URL to that repository to help us with testing?
You can take any.
When I downgrade to Git 2.40.1.windows.1, everything works fine.
The text was updated successfully, but these errors were encountered: