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:
parent
0e6f927108
commit
1b6d4b5c0a
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user