summaryrefslogtreecommitdiff
path: root/vdr-vdrmanager/vdrmanagerthread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'vdr-vdrmanager/vdrmanagerthread.cpp')
-rw-r--r--vdr-vdrmanager/vdrmanagerthread.cpp29
1 files changed, 24 insertions, 5 deletions
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 <string.h>
#include <vdr/plugin.h>
#include <vdr/thread.h>
+#include <openssl/ssl.h>
+
#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();
+
+}