[util,http] set sni on the ssl connection

This commit is contained in:
Michael Saxl 2023-07-20 14:54:22 +02:00 committed by akallabeth
parent bad77f0514
commit bc2caa8504

View File

@ -84,6 +84,7 @@ BOOL freerdp_http_request(const char* url, const char* body, long* status_code,
char buffer[1024] = { 0 };
BIO* bio = NULL;
SSL_CTX* ssl_ctx = NULL;
SSL* ssl = NULL;
WINPR_ASSERT(status_code);
WINPR_ASSERT(response);
@ -149,6 +150,19 @@ BOOL freerdp_http_request(const char* url, const char* body, long* status_code,
goto out;
}
BIO_get_ssl(bio, &ssl);
if (!ssl)
{
log_errors("could not get ssl");
goto out;
}
if (!SSL_set_tlsext_host_name(ssl, hostname))
{
log_errors("could not set sni hostname");
goto out;
}
WLog_DBG(TAG, "headers:\n%s", headers);
ERR_clear_error();
if (BIO_write(bio, headers, strlen(headers)) < 0)