-
What version of Go are you using?
This was first observed with Go 1.5.3, and still exists as of Go 1.7. From cursory historical code inspection, this problem looks like it has existed well before Go 1.5.3.
-
What operating system and processor architecture are you using?
Linux AMD64
-
What did you do?
(A) Verifying TLS server cert from a trusted CA hierarchy: https://play.golang.org/p/6L_GA0ZkcD
- This example simulates what happens when a Go TLS client talks to a TLS server that is sending the root cert as part of the server cert's chain. Even though sending the root is not a TLS best practice, such TLS servers are still quite common on the public Internet.
(B) Verifying TLS server cert that is self-signed: https://play.golang.org/p/ycS8K__AwJ
- This example simulates what is more likely to happen in an enterprise / private environment. Obviously, the Go TLS client must not be using InsecureSkipVerify. Either the TLS server's self-signed cert must be explicitly set as one of the roots in the options passed to x509.Verify or the system's roots must be modified to include the self-signed cert.
-
What did you expect to see?
(A) I expect to see only one verified chain: [Leaf] -> [Intermediate] -> [Root]
(B) I expect to see only one verified chain: [Root]
-
What did you see instead?
(A) I see two verified chains:
- correct: [Leaf] -> [Intermediate] -> [Root]
- *not* correct: [Leaf] -> [Intermediate] -> [Root] -> [Root]
(B) I see one verified chain that is not correct: [Root] -> [Root]
The cause for both (A) and (B) seems to stem from x509.buildChains.
(B) should be fully addressed by yesterday's fix (https://go-review.googlesource.com/#/c/27393/2/src/crypto/x509/verify.go) by @agl for Issue #16763.
What version of Go are you using?
This was first observed with Go 1.5.3, and still exists as of Go 1.7. From cursory historical code inspection, this problem looks like it has existed well before Go 1.5.3.
What operating system and processor architecture are you using?
Linux AMD64
What did you do?
(A) Verifying TLS server cert from a trusted CA hierarchy: https://play.golang.org/p/6L_GA0ZkcD
(B) Verifying TLS server cert that is self-signed: https://play.golang.org/p/ycS8K__AwJ
What did you expect to see?
(A) I expect to see only one verified chain: [Leaf] -> [Intermediate] -> [Root]
(B) I expect to see only one verified chain: [Root]
What did you see instead?
(A) I see two verified chains:
(B) I see one verified chain that is not correct: [Root] -> [Root]
The cause for both (A) and (B) seems to stem from x509.buildChains.
(B) should be fully addressed by yesterday's fix (https://go-review.googlesource.com/#/c/27393/2/src/crypto/x509/verify.go) by @agl for Issue #16763.