summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/ClickAndLoad.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hooks/ClickAndLoad.py')
-rw-r--r--module/plugins/hooks/ClickAndLoad.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py
index 2ddd66daa..1fa89840b 100644
--- a/module/plugins/hooks/ClickAndLoad.py
+++ b/module/plugins/hooks/ClickAndLoad.py
@@ -3,6 +3,11 @@
import socket
import time
+try:
+ import ssl
+except ImportError:
+ pass
+
from threading import Lock
from module.plugins.Hook import Hook, threaded
@@ -24,7 +29,7 @@ def forward(source, destination):
class ClickAndLoad(Hook):
__name__ = "ClickAndLoad"
__type__ = "hook"
- __version__ = "0.41"
+ __version__ = "0.42"
__config__ = [("activated", "bool", "Activated" , True),
("port" , "int" , "Port" , 9666),
@@ -79,6 +84,21 @@ class ClickAndLoad(Hook):
self.logDebug("Connection from %s:%s" % client_addr)
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+
+ if self.config['webinterface']['https']:
+ try:
+ server_socket = ssl.wrap_socket(server_socket)
+
+ except NameError:
+ self.logError(_("pyLoad's webinterface is configured to use HTTPS, Please install python's ssl lib or
+ client_socket.close() #: reset the connection.
+ continue
+
+ except Exception, e:
+ self.logError(_("SSL error: %s") % e.message)
+ client_socket.close() #: reset the connection.
+ continue
+
server_socket.connect(("127.0.0.1", webport))
self.manager.startThread(forward, client_socket, server_socket)