http/client: correct setup of SNI check
Pass TLS hostname set by user to SSL_set_tlsext_host_name().
Disable SNI check for IP addresses.
@@ -507,17 +507,13 @@ static int conn_connect(struct http_req *req)
goto out;
if (req->cli->tlshn)
- err = tls_peer_set_verify_host(conn->sc,
+ err = tls_set_verify_server(conn->sc,
req->cli->tlshn);
else
- err = tls_peer_set_verify_host(conn->sc, req->host);
+ err = tls_set_verify_server(conn->sc, req->host);
if (err)
goto out;
-
- err = tls_set_servername(conn->sc, req->host);
- if (err)
- goto out;
}
#endif
