-
Notifications
You must be signed in to change notification settings - Fork 18k
crypto/x509: Go 1.8's SystemCertPool() on Windows does not return all Windows root CAs #18609
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
Comments
Yes, we know. It happend same on try-bot while review. |
But surely that impacts the usability of I think it's somewhat dangerous: previously, SystemCertPool() would return an error because the intended functionality couldn't be properly implemented on Windows. Now, it returns a subset of the Windows cert pool that that machine has visited before. Programs that were aware of SystemCertPool returning an error on Windows might keep working. |
It is same that UNIX code use the files /etc/ssl/ca-bundle.pem. If the administrator doesn't update ca-bundle, it may be obsolete certificates. https://github.com/golang/go/blob/master/src/crypto/x509/root_linux.go#L9-L13 |
Yes, the But that isn't the problem. The problem is that So that means the the behavior of something like:
will return a different "truth" than
which to me is very unexpected. |
It was kept to not change the behavior. please see comments on https://go-review.googlesource.com/#/c/30578/1/src/crypto/x509/verify.go |
@mkrautz I agree that SystemCertPool on Windows could return misleading results. I do not see technical way to improve the situation - as you have explained above it just the way Windows works. But (I am not security expert), I think other OSes would have similar problems. What about "certificate revocation lists"? Is SystemCertPool takes "certificate revocation lists" into account? Maybe something similar. We should, probably, document SystemCertPool on Windows shortcomings. Alex |
It sounds like we should pull this from Go 1.8 and try again for Go 1.9. |
Decision: we will revert this for Go 1.8. We don't have time to get it right in a day or two. (Users want to append CAs to the system cert pool and verify with the union of the two; #13335) |
CL https://golang.org/cl/35265 mentions this issue. |
Updates #18609 Change-Id: I8306135660f52cf625bed4c7f53f632e527617de Reviewed-on: https://go-review.googlesource.com/35265 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Russ Cox <[email protected]> Reviewed-by: Quentin Smith <[email protected]>
The upstream change to allow access to the windows system cert pool was reverted, reverting and updating messaging. Maybe 1.9....golang/go#18609 Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
The upstream change to allow access to the windows system cert pool was reverted, reverting and updating messaging. Maybe 1.9....golang/go#18609 Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
@jeffallen Done. Alex |
I believe that Go 1.8's implementation of SystemCertPool on Windows can give some surprising results.
The reason is that Windows doesn't ship with all of its root certificates installed. Instead, it downloads them on-demand.
(See the original implementation of systemVerify on Windows:a324a5a)
This means that there's a difference between what crypto/x509 will verify as OK on Windows with a default VerifyOptions (which uses the systemVerify() function - and will automatically fetch missing root CAs), and attempting to use the SystemCertPool() as the root store in VerifyOptions yourself.
I'm not sure what to do here. Maybe a note in the SystemCertPool docs about the Windows situation is sufficient?
The text was updated successfully, but these errors were encountered: