Fix certificate validation.
asn1: add support for T61String because this is the string type which
several www.google.com certificates are now using for fields like
CommonName
tls: force a handshake in Dial so that certificates are ready
afterwards.
Fixes #1114.
R=rsc
CC=golang-dev
https://golang.org/cl/2216043
diff --git a/src/pkg/crypto/tls/tls.go b/src/pkg/crypto/tls/tls.go
index 27e32cc..2aec160 100644
--- a/src/pkg/crypto/tls/tls.go
+++ b/src/pkg/crypto/tls/tls.go
@@ -67,7 +67,13 @@
if err != nil {
return nil, err
}
- return Client(c, nil), nil
+ conn := Client(c, nil)
+ err = conn.Handshake()
+ if err == nil {
+ return conn, nil
+ }
+ c.Close()
+ return nil, err
}
// LoadX509KeyPair