diff --git a/proxyhttp.go b/proxyhttp.go index dcde977..afe6233 100644 --- a/proxyhttp.go +++ b/proxyhttp.go @@ -416,6 +416,7 @@ func wsDial(req *ProxyRequest, useProxy bool, proxyHost string, proxyPort int, p if req.DestUseTLS { tls_conn := tls.Client(conn, &tls.Config{ InsecureSkipVerify: true, + ServerName: req.DestHost, }) conn = tls_conn } @@ -861,6 +862,7 @@ func submitRequest(req *ProxyRequest, useProxy bool, proxyHost string, if req.DestUseTLS { tls_conn := tls.Client(conn, &tls.Config{ InsecureSkipVerify: true, + ServerName: req.DestHost, }) conn = tls_conn } diff --git a/proxylistener.go b/proxylistener.go index 42d27a5..123e84f 100644 --- a/proxylistener.go +++ b/proxylistener.go @@ -242,6 +242,8 @@ func (pconn *proxyConn) StartMaybeTLS(hostname string) (bool, error) { config := &tls.Config{ InsecureSkipVerify: true, Certificates: []tls.Certificate{cert}, + ServerName: hostname, + } tlsConn := tls.Server(bufConn, config) pconn.conn = tlsConn