aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/ssluse.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/ssluse.c b/lib/ssluse.c
index c0c1ee6de..8d4490fa6 100644
--- a/lib/ssluse.c
+++ b/lib/ssluse.c
@@ -1353,6 +1353,12 @@ static void ssl_tls_trace(int direction, int ssl_ver, int content_type,
#ifdef USE_SSLEAY
/* ====================================================== */
+#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
+# define use_sni(x) sni = (x)
+#else
+# define use_sni(x) do { } while (0)
+#endif
+
static CURLcode
ossl_connect_step1(struct connectdata *conn,
int sockindex)
@@ -1365,8 +1371,8 @@ 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
+ bool sni;
#ifdef ENABLE_IPV6
struct in6_addr addr;
#else
@@ -1385,17 +1391,19 @@ ossl_connect_step1(struct connectdata *conn,
case CURL_SSLVERSION_DEFAULT:
/* we try to figure out version */
req_method = SSLv23_client_method();
+ use_sni(TRUE);
break;
case CURL_SSLVERSION_TLSv1:
req_method = TLSv1_client_method();
+ use_sni(TRUE);
break;
case CURL_SSLVERSION_SSLv2:
req_method = SSLv2_client_method();
- sni = FALSE;
+ use_sni(FALSE);
break;
case CURL_SSLVERSION_SSLv3:
req_method = SSLv3_client_method();
- sni = FALSE;
+ use_sni(FALSE);
break;
}