From 799ced44a3ef3e9550afab7ddee17980cda00177 Mon Sep 17 00:00:00 2001 From: Dieter Hametner Date: Wed, 23 Apr 2008 00:59:34 +0200 Subject: Applied SSL listener patch submitted through bug report #457. --- tntconfig.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tntconfig.cpp') diff --git a/tntconfig.cpp b/tntconfig.cpp index 704ae6f..cdc476e 100644 --- a/tntconfig.cpp +++ b/tntconfig.cpp @@ -121,6 +121,24 @@ void TntConfig::WriteConfig() for ( Setup::IpList::const_iterator ip = ips.begin(); ip != ips.end(); ++ip ) { file << "Listen " << *ip << " " << port << endl; } + +#ifdef TNTVERS7 + int s_port = LiveSetup().GetServerSslPort(); + string s_cert = LiveSetup().GetServerSslCert(); + + if (s_cert.empty()) { + s_cert = configDir + "/live.pem"; + } + + if ( ifstream( s_cert.c_str() ) ) { + for ( Setup::IpList::const_iterator ip = ips.begin(); ip != ips.end(); ++ip ) { + file << "SslListen " << *ip << " " << s_port << " " << s_cert << endl; + } + } + else { + esyslog( "ERROR: %s: %s", s_cert.c_str(), strerror( errno ) ); + } +#endif } void TntConfig::WriteProperties() -- cgit v1.2.3