diff --git a/doc/go1.3.txt b/doc/go1.3.txt index 613d261974a7f..fda35a7e3ff8a 100644 --- a/doc/go1.3.txt +++ b/doc/go1.3.txt @@ -9,3 +9,4 @@ misc/benchcmp has been replaced by go tool benchcmp (CL 47980043) cmd/go, go/build: support .m files (CL 60590044) unicode: upgrade from Unicode 6.2.0 to 6.3.0 (CL 65400044) runtime/debug: add SetPanicOnFault (CL 66590044) +crypto/tls: ServerName or InsecureSkipVerify (CL 67010043) diff --git a/src/pkg/crypto/tls/handshake_client.go b/src/pkg/crypto/tls/handshake_client.go index fd1303eebb947..0d8d9a1d46f9c 100644 --- a/src/pkg/crypto/tls/handshake_client.go +++ b/src/pkg/crypto/tls/handshake_client.go @@ -33,6 +33,10 @@ func (c *Conn) clientHandshake() error { c.config = defaultConfig() } + if len(c.config.ServerName) == 0 && !c.config.InsecureSkipVerify { + return errors.New("tls: either ServerName or InsecureSkipVerify must be specified in the tls.Config") + } + hello := &clientHelloMsg{ vers: c.config.maxVersion(), compressionMethods: []uint8{compressionNone},