mirror of
https://github.com/curl/curl.git
synced 2026-08-25 12:33:35 +03:00
- Curt Bogmine reported a problem with SNI enabled on a particular server. We
should introduce an option to disable SNI, but as we're in feature freeze now I've addressed the obvious bug here (pointed out by Peter Sylvester): we shouldn't try to enable SNI when SSLv2 or SSLv3 is explicitly selected. Code for OpenSSL and GnuTLS was fixed. NSS doesn't seem to have a particular option for SNI, or are we simply not using it?
This commit is contained in:
parent
c0e8bed5bf
commit
6d891d2a3b
5 changed files with 18 additions and 5 deletions
|
|
@ -1351,6 +1351,7 @@ ossl_connect_step1(struct connectdata *conn,
|
|||
X509_LOOKUP *lookup=NULL;
|
||||
curl_socket_t sockfd = conn->sock[sockindex];
|
||||
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
|
||||
bool sni = TRUE; /* default is SNI enabled */
|
||||
#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
|
||||
#ifdef ENABLE_IPV6
|
||||
struct in6_addr addr;
|
||||
|
|
@ -1376,9 +1377,11 @@ ossl_connect_step1(struct connectdata *conn,
|
|||
break;
|
||||
case CURL_SSLVERSION_SSLv2:
|
||||
req_method = SSLv2_client_method();
|
||||
sni = FALSE;
|
||||
break;
|
||||
case CURL_SSLVERSION_SSLv3:
|
||||
req_method = SSLv3_client_method();
|
||||
sni = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1565,6 +1568,7 @@ ossl_connect_step1(struct connectdata *conn,
|
|||
#ifdef ENABLE_IPV6
|
||||
(0 == Curl_inet_pton(AF_INET6, conn->host.name, &addr)) &&
|
||||
#endif
|
||||
sni &&
|
||||
!SSL_set_tlsext_host_name(connssl->handle, conn->host.name))
|
||||
infof(data, "WARNING: failed to configure server name indication (SNI) "
|
||||
"TLS extension\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue