diff options
Diffstat (limited to 'cpp/src/IceSSL/OpenSSLTransceiverI.cpp')
-rw-r--r-- | cpp/src/IceSSL/OpenSSLTransceiverI.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cpp/src/IceSSL/OpenSSLTransceiverI.cpp b/cpp/src/IceSSL/OpenSSLTransceiverI.cpp index 8acfe25a67e..8038b1159b5 100644 --- a/cpp/src/IceSSL/OpenSSLTransceiverI.cpp +++ b/cpp/src/IceSSL/OpenSSLTransceiverI.cpp @@ -187,6 +187,17 @@ OpenSSL::TransceiverI::initialize(IceInternal::Buffer& readBuffer, IceInternal:: SSL_set_verify(_ssl, sslVerifyMode, IceSSL_opensslVerifyCallback); } + + // Server name indication + if (!_incoming && _engine->getServerNameIndication() && !_host.empty() && !IceInternal::isIpAddress(_host)) + { + if (!SSL_set_tlsext_host_name(_ssl, _host.c_str())) + { + ostringstream ostr; + ostr << "IceSSL: failed to set SNI host " << _host << " with SSL_set_tlsext_host_name"; + throw SecurityException(__FILE__, __LINE__, ostr.str()); + } + } } while(!SSL_is_init_finished(_ssl)) |