fix: Use parsedUrl.Hostname() for TLS SNI
This commit is contained in:
@@ -81,7 +81,7 @@ func ConnectAndGetData(url string) ([]byte, error) {
|
|||||||
// Perform the TLS handshake
|
// Perform the TLS handshake
|
||||||
tlsConfig := &tls.Config{
|
tlsConfig := &tls.Config{
|
||||||
InsecureSkipVerify: true, // Accept all TLS certs, even if insecure.
|
InsecureSkipVerify: true, // Accept all TLS certs, even if insecure.
|
||||||
ServerName: parsedUrl.Host, // SNI
|
ServerName: parsedUrl.Hostname(), // SNI should not include port
|
||||||
// MinVersion: tls.VersionTLS12, // Use a minimum TLS version. Warning breaks a lot of sites.
|
// MinVersion: tls.VersionTLS12, // Use a minimum TLS version. Warning breaks a lot of sites.
|
||||||
}
|
}
|
||||||
tlsConn := tls.Client(conn, tlsConfig)
|
tlsConn := tls.Client(conn, tlsConfig)
|
||||||
|
|||||||
Reference in New Issue
Block a user