From d31526aecdfd3626bd3c4cbbcd196b6e7d0a89a3 Mon Sep 17 00:00:00 2001 From: imaginos Date: Wed, 18 May 2005 22:18:47 +0000 Subject: [PATCH] grab default pem file git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@340 726aef4b-f618-498e-8847-2d620e286838 --- modules/modperl.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/modules/modperl.cpp b/modules/modperl.cpp index 2c703bcd..23521108 100644 --- a/modules/modperl.cpp +++ b/modules/modperl.cpp @@ -785,8 +785,25 @@ XS(XS_ZNC_COREListen) if ( iEnableReadline ) pSock->EnableReadLine(); - if ( MANAGER->ListenHost( iPort, ZNCSOCK, sHostname, ( iUseSSL != 0 ), SOMAXCONN, pSock ) ) - sReturn = pSock->GetRSock(); + bool bContinue = true; + if ( iUseSSL != 0 ) + { + if ( CFile::Exists( g_ModPerl->GetUser()->GetPemLocation() ) ) + pSock->SetPemLocation( g_ModPerl->GetUser()->GetPemLocation() ); + else + { + PutModule( "PEM File does not exist! (looking for " + g_ModPerl->GetUser()->GetPemLocation() + ")" ); + bContinue = false; + } + } + + if ( bContinue ) + { + if ( MANAGER->ListenHost( iPort, ZNCSOCK, sHostname, ( iUseSSL != 0 ), SOMAXCONN, pSock ) ) + sReturn = pSock->GetRSock(); + } + else + sReturn = -1; XPUSHs( sReturn.GetSV() );