diff --git a/fdskun.py b/fdskun.py index ec4b865..c6c53bc 100644 --- a/fdskun.py +++ b/fdskun.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from twisted.words.protocols import irc -from twisted.internet import reactor, protocol +from twisted.internet import reactor, protocol, ssl from twisted.python import usage, log from twisted.internet import inotify from twisted.python import filepath @@ -141,6 +141,7 @@ if __name__ == '__main__': host = config.get('irc', 'host') port = int(config.get('irc', 'port')) + ssl_switch = config.get('irc', 'ssl') channel = config.get('irc', 'channel') nickname = config.get('irc', 'nickname') nickserv_pw = config.get('irc', 'nickserv_pw') @@ -153,7 +154,10 @@ if __name__ == '__main__': f = MonitorBotFactory(nickname, channel, nickserv_pw, fsmon) # connect factory to this host and port - reactor.connectTCP(host, port, f) + if ssl_switch == 'no': + reactor.connectTCP(host, port, f) + else: + reactor.connectSSL(host, port, f, ssl.ClientContextFactory()) # run bot reactor.run() diff --git a/requirements.txt b/requirements.txt index b8644b3..83de952 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ coverage pyopenssl twisted +service_identity diff --git a/settings.ini.example b/settings.ini.example index 06cd86e..68d1ffe 100644 --- a/settings.ini.example +++ b/settings.ini.example @@ -1,6 +1,8 @@ [irc] host = irc.euirc.net port = 6667 +ssl = no +ssl = yes nickName = FDS-kun realName = bot: provides tracking of an ftp folder channel = #JPT