summaryrefslogtreecommitdiff
path: root/cpp/src/IceSSL/UWPTransceiverI.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2017-02-15 09:36:12 +0100
committerJose <jose@zeroc.com>2017-02-15 09:36:12 +0100
commitcc03d275e09ed3092efa114429ac068eef352f22 (patch)
tree276a86cd682c438c3c03a0cb16723e4385cd8ffa /cpp/src/IceSSL/UWPTransceiverI.cpp
parentFixed (ICE-6463) - Cache the IceSSL connection information (diff)
downloadice-cc03d275e09ed3092efa114429ac068eef352f22.tar.bz2
ice-cc03d275e09ed3092efa114429ac068eef352f22.tar.xz
ice-cc03d275e09ed3092efa114429ac068eef352f22.zip
UWP Cache IceSSL connection info
Diffstat (limited to 'cpp/src/IceSSL/UWPTransceiverI.cpp')
-rw-r--r--cpp/src/IceSSL/UWPTransceiverI.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/cpp/src/IceSSL/UWPTransceiverI.cpp b/cpp/src/IceSSL/UWPTransceiverI.cpp
index 2d44de962c5..b58a688733f 100644
--- a/cpp/src/IceSSL/UWPTransceiverI.cpp
+++ b/cpp/src/IceSSL/UWPTransceiverI.cpp
@@ -198,6 +198,17 @@ IceSSL::TransceiverI::initialize(IceInternal::Buffer& readBuffer, IceInternal::B
throw SecurityException(__FILE__, __LINE__, "IceSSL: certificate required");
}
+ if(_chain)
+ {
+ auto certs = _chain->GetCertificates(true);
+ for(auto iter = certs->First(); iter->HasCurrent; iter->MoveNext())
+ {
+ auto cert = ICE_MAKE_SHARED(Certificate, iter->Current);
+ _nativeCerts.push_back(cert);
+ _certs.push_back(cert->encode());
+ }
+ }
+
_engine->verifyPeer(_host, dynamic_pointer_cast<IceSSL::NativeConnectionInfo>(getInfo()), toString());
}
catch(Platform::Exception^ ex)
@@ -322,20 +333,12 @@ Ice::ConnectionInfoPtr
IceSSL::TransceiverI::getInfo() const
{
NativeConnectionInfoPtr info = ICE_MAKE_SHARED(NativeConnectionInfo);
- StreamSocket^ stream = safe_cast<StreamSocket^>(_delegate->getNativeInfo()->fd());
- if(_chain)
- {
- auto certs = _chain->GetCertificates(true);
- for(auto iter = certs->First(); iter->HasCurrent; iter->MoveNext())
- {
- info->nativeCerts.push_back(ICE_MAKE_SHARED(Certificate, iter->Current));
- info->certs.push_back(info->nativeCerts.back()->encode());
- }
- }
info->verified = _verified;
info->adapterName = _adapterName;
info->incoming = _incoming;
info->underlying = _delegate->getInfo();
+ info->certs = _certs;
+ info->nativeCerts = _nativeCerts;
return info;
}