downloader: support TLS SNI when negotiating with SSL server

This commit is contained in:
rdb 2017-01-28 17:41:09 +01:00
parent 3318e254b8
commit c3a196860a

View File

@ -1474,6 +1474,14 @@ run_setup_ssl() {
return false;
}
string hostname = _request.get_url().get_server();
result = SSL_set_tlsext_host_name(ssl, hostname.c_str());
if (result == 0) {
downloader_cat.error()
<< _NOTIFY_HTTP_CHANNEL_ID
<< "Could not set TLS SNI hostname to '" << hostname << "'\n";
}
/*
* It would be nice to use something like SSL_set_client_cert_cb() here to set
* a callback to provide the certificate should it be requested, or even to