summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/SslFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/SslFactory.cpp')
-rw-r--r--cpp/src/Ice/SslFactory.cpp33
1 files changed, 24 insertions, 9 deletions
diff --git a/cpp/src/Ice/SslFactory.cpp b/cpp/src/Ice/SslFactory.cpp
index 63ac8f9899d..2210a146d8c 100644
--- a/cpp/src/Ice/SslFactory.cpp
+++ b/cpp/src/Ice/SslFactory.cpp
@@ -35,18 +35,17 @@ namespace IceSecurity
namespace Ssl
{
-
-extern "C"
-{
- void lockingCallback(int, int, const char*, int);
-}
-
// Static member instantiations.
IceUtil::Mutex Factory::_systemRepositoryMutex;
SystemMap Factory::_systemRepository;
SslHandleSystemMap Factory::_sslHandleSystemRepository;
int Factory::_evict = 0;
+extern "C"
+{
+ void lockingCallback(int, int, const char*, int);
+}
+
class SslLockKeeper
{
@@ -83,9 +82,8 @@ void IceSecurity::Ssl::lockingCallback(int mode, int type, const char *file, int
}
}
-
IceSecurity::Ssl::SystemPtr
-IceSecurity::Ssl::Factory::getSystem(string& systemIdentifier)
+IceSecurity::Ssl::Factory::getSystem(const string& systemIdentifier)
{
IceUtil::Mutex::Lock sync(_systemRepositoryMutex);
@@ -145,7 +143,6 @@ IceSecurity::Ssl::Factory::getSystemFromHandle(void* sslHandle)
return system;
}
-
void
IceSecurity::Ssl::Factory::reapSystems()
{
@@ -194,3 +191,21 @@ IceSecurity::Ssl::Factory::reapSystems()
}
}
+void
+IceSecurity::Ssl::setSystemCertificateVerifier(const string& systemIdentifier,
+ CertificateVerifierType verifierType,
+ const CertificateVerifierPtr& certificateVerifier)
+{
+ SystemPtr sslSystem = Factory::getSystem(systemIdentifier);
+
+ if ((verifierType == Client) || (verifierType == ClientServer))
+ {
+ sslSystem->setClientCertificateVerifier(certificateVerifier);
+ }
+
+ if ((verifierType == Server) || (verifierType == ClientServer))
+ {
+ sslSystem->setServerCertificateVerifier(certificateVerifier);
+ }
+}
+