From 75516dd3d04aa9a8f61adfb882d5d78b9267b613 Mon Sep 17 00:00:00 2001 From: bju Date: Sun, 21 Apr 2013 19:52:23 +0200 Subject: implemented server side --- vdr-vdrmanager/vdrmanagerthread.cpp | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'vdr-vdrmanager/vdrmanagerthread.cpp') diff --git a/vdr-vdrmanager/vdrmanagerthread.cpp b/vdr-vdrmanager/vdrmanagerthread.cpp index 2a4ca64..977f3d1 100644 --- a/vdr-vdrmanager/vdrmanagerthread.cpp +++ b/vdr-vdrmanager/vdrmanagerthread.cpp @@ -4,16 +4,21 @@ #include #include #include +#include + #include "vdrmanagerthread.h" #include "select.h" #include "helpers.h" -cVdrManagerThread::cVdrManagerThread(int port, const char * password, bool forceCheckSvdrp) +cVdrManagerThread::cVdrManagerThread(int port, const char * password, bool forceCheckSvdrp, + bool useSSL, const char * pemFile) { select = NULL; - this -> port = port; - this -> password = password; - this -> forceCheckSvdrp = forceCheckSvdrp; + this->port = port; + this->password = password; + this->forceCheckSvdrp = forceCheckSvdrp; + this->useSSL = useSSL; + this->pemFile = pemFile; } cVdrManagerThread::~cVdrManagerThread() @@ -23,6 +28,11 @@ cVdrManagerThread::~cVdrManagerThread() void cVdrManagerThread::Action(void) { + // initialize SSL + if (useSSL) { + InitSSL(); + } + // create listener socket if (!Init()) return; @@ -43,7 +53,7 @@ bool cVdrManagerThread::Init() // create server socket cVdrmanagerServerSocket * sock = new cVdrmanagerServerSocket(); - if (sock == NULL || !sock->Create(port, password, forceCheckSvdrp)) + if (sock == NULL || !sock->Create(port, password, forceCheckSvdrp, useSSL, pemFile)) return false; // register server socket @@ -61,3 +71,12 @@ void cVdrManagerThread::Cleanup() void cVdrManagerThread::Shutdown() { } + +bool cVdrManagerThread::InitSSL() { + + SSL_library_init(); + SSL_load_error_strings(); + ERR_load_BIO_strings(); + ERR_load_SSL_strings(); + +} -- cgit v1.2.3