1
0
mirror of https://github.com/golang/go synced 2024-11-20 08:04:42 -07:00

net/http: use tls host instead of proxy, when checking against a certificate

Fixes #4152.

R=bradfitz
CC=golang-dev
https://golang.org/cl/6570045
This commit is contained in:
Christian Himpel 2012-09-25 09:22:13 -07:00 committed by Brad Fitzpatrick
parent 0e6f927108
commit 1b6d4b5c0a

View 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 {