Browse Source

downloader: support TLS SNI when negotiating with SSL server

rdb 9 years ago
parent
commit
c3a196860a
1 changed files with 8 additions and 0 deletions
  1. 8 0
      panda/src/downloader/httpChannel.cxx

+ 8 - 0
panda/src/downloader/httpChannel.cxx

@@ -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