summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/sys/TCPIOPlugin.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-10-20 15:29:46 +0000
committerGordon Sim <gsim@apache.org>2008-10-20 15:29:46 +0000
commit6fcb7dcbd22956828de8aa52a58e66b9df5e7529 (patch)
tree9bdd91484def60b6872fa27c3122cc8477427e04 /cpp/src/qpid/sys/TCPIOPlugin.cpp
parent7aae076e7c8289ea60a69fd54ea93deb4b7fcdfa (diff)
downloadqpid-python-6fcb7dcbd22956828de8aa52a58e66b9df5e7529.tar.gz
Add option to require that only encrypted connections be accepted.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@706321 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/TCPIOPlugin.cpp')
-rw-r--r--cpp/src/qpid/sys/TCPIOPlugin.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/cpp/src/qpid/sys/TCPIOPlugin.cpp b/cpp/src/qpid/sys/TCPIOPlugin.cpp
index 40edfa816f..c4bc99837e 100644
--- a/cpp/src/qpid/sys/TCPIOPlugin.cpp
+++ b/cpp/src/qpid/sys/TCPIOPlugin.cpp
@@ -65,9 +65,14 @@ static class TCPIOPlugin : public Plugin {
// Only provide to a Broker
if (broker) {
const broker::Broker::Options& opts = broker->getOptions();
- ProtocolFactory::shared_ptr protocol(new AsynchIOProtocolFactory(opts.port, opts.connectionBacklog, opts.tcpNoDelay));
- QPID_LOG(info, "Listening on TCP port " << protocol->getPort());
- broker->registerProtocolFactory("tcp", protocol);
+ if (opts.requireEncrypted) {
+ QPID_LOG(info, "Not accepting unencrypted connections on TCP");
+ } else {
+ ProtocolFactory::shared_ptr protocol(new AsynchIOProtocolFactory(opts.port, opts.connectionBacklog,
+ opts.tcpNoDelay));
+ QPID_LOG(info, "Listening on TCP port " << protocol->getPort());
+ broker->registerProtocolFactory("tcp", protocol);
+ }
}
}
} tcpPlugin;