Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Porter <slug@qwebirc.org>2012-02-13 01:24:46 (GMT)
committer Chris Porter <slug@qwebirc.org>2012-02-13 01:24:46 (GMT)
commit9cb19ca883b264a4388b4e49b472832000fcd710 (patch)
tree3e522cc2fcc9d07e2734221d63866444c39435c9
parentbc91808a1a8de83da71130a09a7c8fe458d415e5 (diff)
Fixes issue #152
-rw-r--r--AUTHORS2
-rw-r--r--config.py.example5
-rw-r--r--qwebirc/ircclient.py7
3 files changed, 12 insertions, 2 deletions
diff --git a/AUTHORS b/AUTHORS
index ff3acc0..47f7da0 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -6,3 +6,5 @@ Arne Jensen (DarkDeviL) <darkdevil@darkdevil.dk>
Bas Verhoeven (soczol) <bas@bserved.nl>
Tom Wesley (tomaw) <tom@tomaw.org>
Jason Hill (SecretAgent) <secrtagnt@gmail.com>
+anarcat
+
diff --git a/config.py.example b/config.py.example
index ff33b11..ed210d3 100644
--- a/config.py.example
+++ b/config.py.example
@@ -20,6 +20,11 @@ from qwebirc.config_options import *
# Port of IRC server to connect to.
IRCSERVER, IRCPORT = "irc.myserver.com", 6667
+# OPTION: SSLPORT
+# SSL port of IRC server to connect to.
+# If this option is uncommented it will override IRCPORT.
+#SSLPORT = 6697
+
# OPTION: REALNAME
# The realname field of IRC clients will be set to this value.
REALNAME = "http://moo.com/"
diff --git a/qwebirc/ircclient.py b/qwebirc/ircclient.py
index f517430..2fd09c0 100644
--- a/qwebirc/ircclient.py
+++ b/qwebirc/ircclient.py
@@ -1,6 +1,6 @@
import twisted, sys, codecs, traceback
from twisted.words.protocols import irc
-from twisted.internet import reactor, protocol, abstract
+from twisted.internet import reactor, protocol, abstract, ssl
from twisted.web import resource, server
from twisted.protocols import basic
from twisted.names.client import Resolver
@@ -152,7 +152,10 @@ def createIRC(*args, **kwargs):
tcpkwargs["bindAddress"] = (config.OUTGOING_IP, 0)
if CONNECTION_RESOLVER is None:
- reactor.connectTCP(config.IRCSERVER, config.IRCPORT, f, **tcpkwargs)
+ if hasattr(config, "SSLPORT"):
+ reactor.connectSSL(config.IRCSERVER, config.SSLPORT, f, ssl.ClientContextFactory(), **tcpkwargs)
+ else:
+ reactor.connectTCP(config.IRCSERVER, config.IRCPORT, f, **tcpkwargs)
return f
def callback(result):