diff options
author | Jose <jose@zeroc.com> | 2014-06-06 16:33:11 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2014-06-06 16:33:11 +0200 |
commit | 7ba5b1fa9d9849182b19aebe5bad1570fb82452b (patch) | |
tree | 2b6a4f6407b4cc860d01f6e737959122a719ca3f /cpp/src/IceSSL/PluginI.cpp | |
parent | Fixed ICE-5499, new garbage collection support (diff) | |
download | ice-7ba5b1fa9d9849182b19aebe5bad1570fb82452b.tar.bz2 ice-7ba5b1fa9d9849182b19aebe5bad1570fb82452b.tar.xz ice-7ba5b1fa9d9849182b19aebe5bad1570fb82452b.zip |
Fixed (ICE-4894) - Native SSL implementation for OS X
Diffstat (limited to 'cpp/src/IceSSL/PluginI.cpp')
-rw-r--r-- | cpp/src/IceSSL/PluginI.cpp | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/cpp/src/IceSSL/PluginI.cpp b/cpp/src/IceSSL/PluginI.cpp index 91e07455ff8..02f9cf1a6e1 100644 --- a/cpp/src/IceSSL/PluginI.cpp +++ b/cpp/src/IceSSL/PluginI.cpp @@ -30,8 +30,7 @@ extern "C" ICE_DECLSPEC_EXPORT Ice::Plugin* createIceSSL(const CommunicatorPtr& communicator, const string& /*name*/, const StringSeq& /*args*/) { - PluginI* plugin = new PluginI(communicator); - return plugin; + return new PluginI(communicator); } } @@ -41,8 +40,12 @@ createIceSSL(const CommunicatorPtr& communicator, const string& /*name*/, const // IceSSL::PluginI::PluginI(const Ice::CommunicatorPtr& communicator) { - _sharedInstance = new SharedInstance(communicator); - +#ifdef ICE_USE_OPENSSL + _engine = new OpenSSLEngine(communicator); +#else + _engine = new SecureTransportEngine(communicator); +#endif + IceInternal::ProtocolPluginFacadePtr facade = IceInternal::getProtocolPluginFacade(communicator); // @@ -50,42 +53,44 @@ IceSSL::PluginI::PluginI(const Ice::CommunicatorPtr& communicator) // in initialize, because the communicator may need to interpret // proxies before the plug-in is fully initialized. // - facade->addEndpointFactory(new EndpointFactoryI(new Instance(_sharedInstance, EndpointType, "ssl"))); + facade->addEndpointFactory(new EndpointFactoryI(new Instance(_engine, EndpointType, "ssl"))); } void IceSSL::PluginI::initialize() { - _sharedInstance->initialize(); + _engine->initialize(); } void IceSSL::PluginI::destroy() { - _sharedInstance->destroy(); - _sharedInstance = 0; + _engine->destroy(); + _engine = 0; } void -IceSSL::PluginI::setContext(SSL_CTX* context) +IceSSL::PluginI::setCertificateVerifier(const CertificateVerifierPtr& verifier) { - _sharedInstance->context(context); + _engine->setCertificateVerifier(verifier); } -SSL_CTX* -IceSSL::PluginI::getContext() +void +IceSSL::PluginI::setPasswordPrompt(const PasswordPromptPtr& prompt) { - return _sharedInstance->context(); + _engine->setPasswordPrompt(prompt); } +#ifdef ICE_USE_OPENSSL void -IceSSL::PluginI::setCertificateVerifier(const CertificateVerifierPtr& verifier) +IceSSL::PluginI::setContext(ContextRef context) { - _sharedInstance->setCertificateVerifier(verifier); + _engine->context(context); } -void -IceSSL::PluginI::setPasswordPrompt(const PasswordPromptPtr& prompt) +ContextRef +IceSSL::PluginI::getContext() { - _sharedInstance->setPasswordPrompt(prompt); + return _engine->context(); } +#endif |