diff options
author | Daniel Stenberg <daniel@haxx.se> | 2022-01-23 00:06:14 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2022-01-23 11:59:54 +0100 |
commit | adcddc214e452d3bfeb3c93bceb775a5ccd3f519 (patch) | |
tree | 26085b1ee41f63c993414d619f742e12a1fdcb4b | |
parent | eeb6f7e970839cb62374e05a3e871cb6257982f6 (diff) | |
download | curl-adcddc214e452d3bfeb3c93bceb775a5ccd3f519.tar.gz |
schannel: set the right SNI name
-rw-r--r-- | lib/vtls/schannel.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 0a8e60610..300a97e55 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2012 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 2012 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 2012 - 2016, Marc Hoersken, <info@marc-hoersken.de> * Copyright (C) 2012, Mark Salisbury, <mark.salisbury@hp.com> * @@ -936,9 +936,14 @@ schannel_connect_step1(struct Curl_easy *data, struct connectdata *conn, return CURLE_OUT_OF_MEMORY; } - host_name = curlx_convert_UTF8_to_tchar(hostname); - if(!host_name) - return CURLE_OUT_OF_MEMORY; + { + char *snihost = Curl_ssl_snihost(data, hostname, NULL); + if(!snihost) + return CURLE_SSL_CONNECT_ERROR; + host_name = curlx_convert_UTF8_to_tchar(snihost); + if(!host_name) + return CURLE_OUT_OF_MEMORY; + } /* Schannel InitializeSecurityContext: https://msdn.microsoft.com/en-us/library/windows/desktop/aa375924.aspx |