summaryrefslogtreecommitdiff
path: root/cpp/src/IceSSL/SecureTransportTransceiverI.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2019-09-06 18:49:02 +0200
committerJose <jose@zeroc.com>2019-09-06 18:52:30 +0200
commitf77a9b7847525d56ba64a0631652401885457a9e (patch)
treea3283476120c498a6e28bc0712d51886e64125e3 /cpp/src/IceSSL/SecureTransportTransceiverI.cpp
parentMark SNI support in UWP as not tested (diff)
downloadice-f77a9b7847525d56ba64a0631652401885457a9e.tar.bz2
ice-f77a9b7847525d56ba64a0631652401885457a9e.tar.xz
ice-f77a9b7847525d56ba64a0631652401885457a9e.zip
Enable SNI extension with CheckCertName > 1
- Remove IceSSL.ServerNameIndication, IceSSL.CheckCertName = 2 should be used instead. - Minor style fixes
Diffstat (limited to 'cpp/src/IceSSL/SecureTransportTransceiverI.cpp')
-rw-r--r--cpp/src/IceSSL/SecureTransportTransceiverI.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/cpp/src/IceSSL/SecureTransportTransceiverI.cpp b/cpp/src/IceSSL/SecureTransportTransceiverI.cpp
index d44d3e796e7..a52067b962d 100644
--- a/cpp/src/IceSSL/SecureTransportTransceiverI.cpp
+++ b/cpp/src/IceSSL/SecureTransportTransceiverI.cpp
@@ -243,13 +243,15 @@ IceSSL::SecureTransport::TransceiverI::initialize(IceInternal::Buffer& readBuffe
sslErrorToString(err));
}
- if (!_incoming && _engine->getServerNameIndication() && !_host.empty() && !IceInternal::isIpAddress(_host))
+ //
+ // Enable SNI
+ //
+ if(!_incoming && _engine->getServerNameIndication() && !_host.empty() && !IceInternal::isIpAddress(_host))
{
- if ((err = SSLSetPeerDomainName(_ssl.get(), _host.data(), _host.length())))
+ if((err = SSLSetPeerDomainName(_ssl.get(), _host.data(), _host.length())))
{
- ostringstream ostr;
- ostr << "IceSSL: failed to set SNI host " << _host << " with SSLSetPeerDomainName\n" << sslErrorToString(err);
- throw SecurityException(__FILE__, __LINE__, ostr.str());
+ throw SecurityException(__FILE__, __LINE__, "IceSSL: setting SNI host failed `" + _host + "'\n" +
+ sslErrorToString(err));
}
}
}