From 0697a5a61dca335941cf403eb0416ef674c3fe09 Mon Sep 17 00:00:00 2001 From: sgm Date: Tue, 8 Oct 2013 22:44:53 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B4=87=20SSL=20=EC=82=AC=EC=9A=A9=20?= =?UTF-8?q?=EC=98=B5=EC=85=98=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot.py | 7 +++++-- config.py.example | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 1374fc7..711ca6b 100644 --- a/bot.py +++ b/bot.py @@ -4,7 +4,6 @@ import irc.client import irc.connection -import ssl import pymongo import datetime @@ -14,7 +13,11 @@ class SBot(irc.bot.SingleServerIRCBot): def __init__(self): - factory = irc.connection.Factory(wrapper=ssl.wrap_socket) + if config.USE_SSL: + import ssl + factory = irc.connection.Factory(wrapper=ssl.wrap_socket) + else: + factory = irc.connection.Factory() irc.bot.SingleServerIRCBot.__init__(self, [(config.SERVER, config.PORT), ], config.BOT_NAME, diff --git a/config.py.example b/config.py.example index dbd56b8..37f991e 100644 --- a/config.py.example +++ b/config.py.example @@ -13,6 +13,7 @@ NOTIFY_NAME = '!' # IRC SERVER = 'irc.uriirc.org' +USE_SSL = True PORT = 16662 BOT_NAME = 's' OPERATOR_NAME = 'sgm'