crypto/tls: Support providing additional _intermediate_ certs for verification in tls.Config #31791
Labels
FrozenDueToAge
Proposal
Proposal-Crypto
Proposal related to crypto packages or other security issues
Milestone
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?
In a TLS connection, the server is supposed to send a chain of certificates that connects from the leaf to the root founding in a client's trust store. Unfortunately some servers are misconfigured, and do not send the necessary intermediates (generally they only serve a leaf, although every once in a while you see one that serves the wrong intermediate).
In order to work around this, developers often find either the leaf or the intermediate for the server they're trying to communicate with, and add it to the trust store. This is unfortunate because it's relatively brittle (particularly if they add the leaf, which should rotate regularly), and it's less secure -- if the root is removed from their trust store, connections will continue to be trusted.
Instead, if there was a way to provide
tls.Config
with additional Intermediates, this could be used more safely -- it would not override the trusted roots, merely allow users to compensate for misconfigured servers.I believe fixing this would look like adding a
Intermediates x509.CertPool
ontotls.Config
and then copying it over for verification around here https://github.com/golang/go/blob/master/src/crypto/tls/handshake_client.go#L827 (and the equivalent for the server side, naturally).The text was updated successfully, but these errors were encountered: