summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2022-01-22 23:59:27 +0100
committerDaniel Stenberg <daniel@haxx.se>2022-01-23 11:59:54 +0100
commit1ab281ae7ceb79e72170f09124db78bdd331c0b5 (patch)
tree44748bf6c40a093ad6dd0810d2c0975a3c6a84f6
parent40dd059a92625767c8c1865434069e55fccfbe8f (diff)
downloadcurl-1ab281ae7ceb79e72170f09124db78bdd331c0b5.tar.gz
gskit: set the right SNI name
-rw-r--r--lib/vtls/gskit.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/vtls/gskit.c b/lib/vtls/gskit.c
index e451f6aeb..93c5cbf08 100644
--- a/lib/vtls/gskit.c
+++ b/lib/vtls/gskit.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -830,8 +830,11 @@ static CURLcode gskit_connect_step1(struct Curl_easy *data,
/* Process SNI. Ignore if not supported (on OS400 < V7R1). */
if(sni) {
+ char *snihost = Curl_ssl_snihost(data, sni, NULL);
+ if(!snihost)
+ return CURLE_SSL_CONNECT_ERROR;
result = set_buffer(data, BACKEND->handle,
- GSK_SSL_EXTN_SERVERNAME_REQUEST, sni, TRUE);
+ GSK_SSL_EXTN_SERVERNAME_REQUEST, snihost, TRUE);
if(result == CURLE_UNSUPPORTED_PROTOCOL)
result = CURLE_OK;
}