crypto/tls: explicitly require ExtKeyUsageClientAuth for client certs

If we aren't explicit about the KeyUsages, the verifier
will treat the certificate as a server certificate and require
it to have a ExtKeyUsageServerAuth key usage.

R=golang-dev
CC=golang-dev
https://golang.org/cl/6453148
This commit is contained in:
Mikkel Krautz 2012-08-18 15:50:33 -07:00 committed by Adam Langley
parent d32fa8a79a
commit 0c7b858b3e

View File

@ -211,6 +211,7 @@ FindCipherSuite:
Roots: c.config.ClientCAs, Roots: c.config.ClientCAs,
CurrentTime: c.config.time(), CurrentTime: c.config.time(),
Intermediates: x509.NewCertPool(), Intermediates: x509.NewCertPool(),
KeyUsages: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth},
} }
for i, cert := range certs { for i, cert := range certs {