-
Notifications
You must be signed in to change notification settings - Fork 18k
crypto/x509: CertPools do not equal each other in 1.16 #45891
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
cc @FiloSottile and @bradfitz for CL 230025 |
I think |
Thanks @FiloSottile . Closing as working as intended. Thanks. |
Where is this documented? I can't seem to find this exception. |
In general, types that contains unexported fields are not supposed to be compared by value, because it compares internal fields, which are internal implementation details. DeepEqual is just worse. |
What do you think about adding an I'm happy to open a separate issue for discussion if that seems like it might be an option. |
@FiloSottile I don't think that comparing I have also not found any documentation before now stating that |
The question is whether equality under |
I opened a new issue about adding the |
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?
Create two
*x509.CertPool
objects from the same PEM[]byte
and then compare them withreflect.DeepEqual
:https://play.golang.com/p/ktVmOf0Qo9W
What did you expect to see?
They should equal each other
What did you see instead?
They did not equal each other
Additional notes
I ran this against Go 1.15.11 and they came out as equal, but in 1.16.3 (and 1.16.2) they are not equal. I also got the same results when wrapping the CertPool in a
*tls.Config
then comparing against aClone
d config.The text was updated successfully, but these errors were encountered: