From 78124a697c5e72c63f207961ea6aebba82969a18 Mon Sep 17 00:00:00 2001 From: rjongbloed Date: Fri, 7 Sep 2007 05:44:14 +0000 Subject: [PATCH] Fixed initialisation of SSL context in both OpalListenerTCPS contructors. --- include/opal/transports.h | 9 +++++++-- src/opal/transports.cxx | 23 +++++++++++++++++------ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/include/opal/transports.h b/include/opal/transports.h index fc826937..495c7566 100644 --- a/include/opal/transports.h +++ b/include/opal/transports.h @@ -29,6 +29,9 @@ * http://www.jfcom.mil/about/abt_j9.htm * * $Log$ + * Revision 2.29 2007/09/07 05:44:14 rjongbloed + * Fixed initialisation of SSL context in both OpalListenerTCPS contructors. + * * Revision 2.28 2007/07/24 13:46:45 rjongbloed * Fixed correct selection of interface after forked INVITE reply arrives on bundled socket. * @@ -1298,8 +1301,10 @@ class OpalListenerTCPS : public OpalListenerTCP OpalTransport * Accept(const PTimeInterval & timeout); const char * GetProtoPrefix() const; - protected: - PSSLContext * sslContext; + protected: + void Construct(); + + PSSLContext * sslContext; }; class OpalTransportTCPS : public OpalTransportTCP diff --git a/src/opal/transports.cxx b/src/opal/transports.cxx index 4da8c66e..7a8e6b10 100644 --- a/src/opal/transports.cxx +++ b/src/opal/transports.cxx @@ -29,6 +29,9 @@ * http://www.jfcom.mil/about/abt_j9.htm * * $Log$ + * Revision 2.88 2007/09/07 05:44:15 rjongbloed + * Fixed initialisation of SSL context in both OpalListenerTCPS contructors. + * * Revision 2.87 2007/08/26 20:17:44 hfriederich * Allow to filter interfaces based on destination address * @@ -2095,12 +2098,7 @@ OpalListenerTCPS::OpalListenerTCPS(OpalEndPoint & ep, BOOL exclusive) : OpalListenerTCP(ep, binding, port, exclusive) { - listenerPort = port; - sslContext = new PSSLContext(); - PString certificateFile = endpoint.GetSSLCertificate(); - if (!SetSSLCertificate(*sslContext, certificateFile, TRUE)) { - PTRACE(1, "OpalTCPS\tCould not load certificate \"" << certificateFile << '"'); - } + Construct(); } @@ -2109,6 +2107,7 @@ OpalListenerTCPS::OpalListenerTCPS(OpalEndPoint & ep, OpalTransportAddress::BindOptions option) : OpalListenerTCP(ep, binding, option) { + Construct(); } @@ -2117,6 +2116,18 @@ OpalListenerTCPS::~OpalListenerTCPS() delete sslContext; } + +void OpalListenerTCPS::Construct() +{ + sslContext = new PSSLContext(); + + PString certificateFile = endpoint.GetSSLCertificate(); + if (!SetSSLCertificate(*sslContext, certificateFile, TRUE)) { + PTRACE(1, "OpalTCPS\tCould not load certificate \"" << certificateFile << '"'); + } +} + + OpalTransport * OpalListenerTCPS::Accept(const PTimeInterval & timeout) { if (!listener.IsOpen()) -- 2.11.4.GIT