diff options
author | Robert Müller <rm@flipez.de> | 2014-11-01 00:10:06 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-11-01 00:10:06 +0100 |
commit | 5fb500416177562d5fed138e4f840d17b4fb604f (patch) | |
tree | b9eb8ef8265cdc7aa0be33ba98474b1133becd47 /module | |
parent | [MegaNz] Fix SSL protocol error (thx cocoto) (diff) | |
download | pyload-5fb500416177562d5fed138e4f840d17b4fb604f.tar.xz |
[IRCInterface] Initial SSL Support
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/hooks/IRCInterface.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 4bf2c7866..4d0cd1619 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -2,6 +2,7 @@ import re import socket +import ssl import time from pycurl import FORM_FILE @@ -19,12 +20,13 @@ from module.utils import formatSize class IRCInterface(Thread, Hook): __name__ = "IRCInterface" __type__ = "hook" - __version__ = "0.11" + __version__ = "0.12" __config__ = [("host", "str", "IRC-Server Address", "Enter your server here!"), ("port", "int", "IRC-Server Port", 6667), ("ident", "str", "Clients ident", "pyload-irc"), ("realname", "str", "Realname", "pyload-irc"), + ("ssl", "bool", "Use SSL", False), ("nick", "str", "Nickname the Client will take", "pyLoad-IRC"), ("owner", "str", "Nickname the Client will accept commands from", "Enter your nick here!"), ("info_file", "bool", "Inform about every file finished", False), @@ -85,6 +87,10 @@ class IRCInterface(Thread, Hook): self.sock = socket.socket() host = self.getConfig("host") self.sock.connect((host, self.getConfig("port"))) + + if self.getConfig("ssl"): + self.sock = ssl.wrap_socket(self.sock, cert_reqs=ssl.CERT_NONE) #@TODO: support certificate + nick = self.getConfig("nick") self.sock.send("NICK %s\r\n" % nick) self.sock.send("USER %s %s bla :%s\r\n" % (nick, host, nick)) |