summaryrefslogtreecommitdiff
path: root/vdr-vdrmanager/clientsock.cpp
diff options
context:
space:
mode:
authorlado <herrlado@gmail.com>2019-10-10 23:02:42 +0200
committerlado <herrlado@gmail.com>2019-10-10 23:02:42 +0200
commit3a8b944ee18ae2db7e60bce1fb600d2b0ce6428c (patch)
tree221a9b2a925c1df63eb6ad83461fbf810cc55cf1 /vdr-vdrmanager/clientsock.cpp
parentc2ce599d38e1ea8027df0fb7b5b76d0d42432db5 (diff)
parent0398f105bcc166d2695f3b8b2f91327c04acca48 (diff)
downloadvdr-manager-master.tar.gz
vdr-manager-master.tar.bz2
Merge branch 'master' of ssh://projects.vdr-developer.org/vdr-managerHEADmaster
Diffstat (limited to 'vdr-vdrmanager/clientsock.cpp')
-rw-r--r--vdr-vdrmanager/clientsock.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/vdr-vdrmanager/clientsock.cpp b/vdr-vdrmanager/clientsock.cpp
index 0bce192..133fba6 100644
--- a/vdr-vdrmanager/clientsock.cpp
+++ b/vdr-vdrmanager/clientsock.cpp
@@ -35,6 +35,7 @@ cVdrmanagerClientSocket::cVdrmanagerClientSocket(const char * password, int comp
initCompression = false;
#if VDRMANAGER_USE_SSL
ssl = NULL;
+ sslCtx = NULL;
sslReadWrite = SSL_NO_RETRY;
sslWantsSelect = SSL_ERROR_NONE;
#endif
@@ -399,11 +400,14 @@ bool cVdrmanagerClientSocket::Attach(int fd) {
if (!LoadCerts()) {
return false;
}
- ssl = SSL_new(sslCtx);
- SSL_set_accept_state(ssl);
- BIO *bio = BIO_new_socket(sock, BIO_NOCLOSE);
- SSL_set_bio(ssl, bio, bio);
- BIO_set_nbio(bio, 1);
+
+ if (certFile) {
+ ssl = SSL_new(sslCtx);
+ SSL_set_accept_state(ssl);
+ BIO *bio = BIO_new_socket(sock, BIO_NOCLOSE);
+ SSL_set_bio(ssl, bio, bio);
+ BIO_set_nbio(bio, 1);
+ }
#endif
return true;