]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: use tls host instead of proxy, when checking against a certificate
authorChristian Himpel <chressie@googlemail.com>
Tue, 25 Sep 2012 16:22:13 +0000 (09:22 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 25 Sep 2012 16:22:13 +0000 (09:22 -0700)
Fixes #4152.

R=bradfitz
CC=golang-dev
https://golang.org/cl/6570045

src/pkg/net/http/transport.go

index a33d787f25d958aab58d99cba405844743b045a6..651f3ce0081bf9b5d213b2e8c0d5f4fb18b40fc3 100644 (file)
@@ -381,7 +381,7 @@ func (t *Transport) getConn(cm *connectMethod) (*persistConn, error) {
                // Initiate TLS and check remote host name against certificate.
                cfg := t.TLSClientConfig
                if cfg == nil || cfg.ServerName == "" {
-                       host, _, _ := net.SplitHostPort(cm.addr())
+                       host := cm.tlsHost()
                        if cfg == nil {
                                cfg = &tls.Config{ServerName: host}
                        } else {