diff options
Diffstat (limited to 'qpid/cpp/src/qpid')
-rw-r--r-- | qpid/cpp/src/qpid/client/SslConnector.cpp | 10 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/client/ssl.h | 30 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/messaging/amqp/SslTransport.cpp | 7 |
3 files changed, 47 insertions, 0 deletions
diff --git a/qpid/cpp/src/qpid/client/SslConnector.cpp b/qpid/cpp/src/qpid/client/SslConnector.cpp index ffe751ab65..7c67196242 100644 --- a/qpid/cpp/src/qpid/client/SslConnector.cpp +++ b/qpid/cpp/src/qpid/client/SslConnector.cpp @@ -161,6 +161,16 @@ namespace { } } +void initialiseSSL() +{ + init.checkInitialised(); +} + +void shutdownSSL() +{ + if (StaticInit::initialised) shutdownNSS(); +} + SslConnector::SslConnector(Poller::shared_ptr p, ProtocolVersion ver, const ConnectionSettings& settings, diff --git a/qpid/cpp/src/qpid/client/ssl.h b/qpid/cpp/src/qpid/client/ssl.h new file mode 100644 index 0000000000..0adef21f7e --- /dev/null +++ b/qpid/cpp/src/qpid/client/ssl.h @@ -0,0 +1,30 @@ +#ifndef QPID_CLIENT_SSL_H +#define QPID_CLIENT_SSL_H + +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +namespace qpid { +namespace client { +void initialiseSSL(); +void shutdownSSL(); +}} // namespace qpid::client + +#endif /*!QPID_CLIENT_SSL_H*/ diff --git a/qpid/cpp/src/qpid/messaging/amqp/SslTransport.cpp b/qpid/cpp/src/qpid/messaging/amqp/SslTransport.cpp index 30ff636636..ffb64c4421 100644 --- a/qpid/cpp/src/qpid/messaging/amqp/SslTransport.cpp +++ b/qpid/cpp/src/qpid/messaging/amqp/SslTransport.cpp @@ -25,6 +25,7 @@ #include "qpid/sys/AsynchIO.h" #include "qpid/sys/ConnectionCodec.h" #include "qpid/sys/Poller.h" +#include "qpid/client/ssl.h" #include "qpid/log/Statement.h" #include <boost/bind.hpp> #include <boost/format.hpp> @@ -40,6 +41,7 @@ namespace amqp { namespace { Transport* create(TransportContext& c, Poller::shared_ptr p) { + qpid::client::initialiseSSL(); return new SslTransport(c, p); } @@ -49,6 +51,11 @@ struct StaticInit { Transport::add("ssl", &create); }; + + ~StaticInit() + { + qpid::client::shutdownSSL(); + } } init; } |