-
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/tls: expose all presented certs in error type on handshake failure #48152
Comments
cc @FiloSottile |
This proposal has been added to the active column of the proposals project |
Generally this sounds good. What's the proposed API? An error wrapper type for certificate validation failure that includes the peer certificates? Should it also be raise on a failed VerifyPeerCertificates or VerifyConnection? How is this different from #48151 and why does that issue say "it's done wrong for client certificates"? We could generally use a more detailed "what did you do" / "what did you expect" / "what did you see". |
Ping @ptagrawal for answers to @FiloSottile's questions. |
ping @ptagrawal |
An error wrapper type for certificate validation failure that includes the peer certificates? Should it also be raise on a failed VerifyPeerCertificates or VerifyConnection? How is this different from #48151 and why does that issue say "it's done wrong for client certificates"? |
It sounds like the answer is to suggest a new error wrapper type that will hold the certificates and be returned on validation failure? Alternately, is it possible to get this info using a custom VerifyPeerCertificates? Or is there no way to invoke the usual code in that case? |
/cc @golang/security |
You can do it with VerifyConnection/VerifyPeerCertificates, although you have to maintain some state at a higher lexical scope and it's kind of hard to associate a VerifyConnection/VerifyPeerCertificates invocation with an error returned by Handshake. Assuming it's possible to unwrap the Handshake return value to get an error as returned by VerifyConnection/VerifyPeerCertificates, one can implement the certificate check there and return a wrapped error. Still, setting InsecureSkipVerify to bypass the normal checks, then reimplementing them just to return an error wrapper to get access to the certificates is quite burdensome. I wouldn't be opposed to a new error wrapper with an |
It sounds like we need an API, then, specifically a name for the error.
Is this the API? |
Maybe the error name is |
OK, so it sounds like:
Does anyone object to that API? |
Does anyone object to the API in the preceding comment? |
Based on the discussion above, this proposal seems like a likely accept. |
No change in consensus, so accepted. 🎉 |
CC @golang/security Looks like this didn't make 1.19. Moving to backlog. Please recategorize as appropriate. Thanks. |
Change https://go.dev/cl/449336 mentions this issue: |
Hi there, I realized that calls to So, I'm wondering whether or not, now that we have the I'd be happy to open an issue with all the details, but first I wanted to know your opinion, as I see it very tight to this issue, as it just looks as the same/very similar situation may arise from different code locations. cc/ @FiloSottile Thanks! |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Not sure
What operating system and processor architecture are you using (
go env
)?BusyBox OS, ARM architecture
go env
OutputWhat did you do?
This is related to another issue #48151 (comment)
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: