-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
crypto/x509: untrusted intermediates are not used on macOS #35631
Comments
@FiloSottile I think we're still having issues with certificate trust settings on mac os. |
Thanks for the report, can you give us the output of |
The test passes in both cases. However, when the certificate is set to "Use System Defaults" it does not even appear in the debug output. It does appear when set to "Always Trust." |
I'm experiencing the same issue on macOS Mojave, running go 1.13.4. The certificate chain in our environment has two intermediate CAs between the Root CA and the site certificate. If the site certificate's issuing CA isn't marked as Always Trusted, then trust isn't inherited, even though the Root CA is always trusted. I was going to post the code snippet that was failing, but even just |
@emberquill is the intermediate served by the TLS server, or is it relying on finding it in the keychain? Because that's something we don't do (and would be very hard to do with our API): take untrusted certificates from the keychain and pour them into the intermediates pool. As a workaround you can make sure the server provides a full chain to the root. |
It's an issue with my employer's local network rather than the site I'm trying to access. Our network proxy performs TLS inspection, so traffic ends up signed by an internal CA, and the root and intermediaries are all in the Keychain. The Root CA is always trusted, but the two intermediate CAs are set to "Use System Defaults" in the Keychain and thus trigger this error in Go. Changing the intermediate CAs to Always Trusted is a sufficient workaround for me. |
Can you confirm that the proxy doesn't send the intermediate in the TLS handshake? |
I thought I saw an overhaul to how Go interacts with the keychain, but lost the link. Would that change solve this issue? |
CL 227037 changed how the macOS API is called, but didn't change how intermediates in the keychain are treated, they are still ignored. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Change https://golang.org/cl/353132 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Open http connection to a remote server using internal certificate. Web browsers have no issue accepting the certificate.
A workaround is to set the issuing CA to Always Trust in the keychain. Using system defaults does not work.
Basically this seems to be the same issue as #30471 or #30672 except I get a failure even with CGO_ENABLED=0.
What did you expect to see?
No error.
What did you see instead?
x509: certificate signed by unknown authority
The text was updated successfully, but these errors were encountered: