Add basic SNI support

By adding the server name as part of the TLS client configuration, gor
will now support connecting to hosts that require SNI (such as Amazon
API Gateway).
This commit is contained in:
Daniel Solano Gómez
2016-11-23 09:55:54 -05:00
parent 1f24c709c2
commit 963f7a73d7
+1 -1
View File
@@ -89,7 +89,7 @@ func (c *HTTPClient) Connect() (err error) {
}
if c.scheme == "https" {
tlsConn := tls.Client(c.conn, &tls.Config{InsecureSkipVerify: true})
tlsConn := tls.Client(c.conn, &tls.Config{InsecureSkipVerify: true, ServerName: c.host})
if err = tlsConn.Handshake(); err != nil {
return