From: Chris Porter Date: Mon, 13 Feb 2012 01:24:46 +0000 (+0000) Subject: Fixes issue #149 X-Git-Url: https://jfr.im/git/irc/quakenet/qwebirc.git/commitdiff_plain/bf568ed81fe6280dbc8e75b0d1b7382080993d69?hp=133b713268a4318673350849ae26e71af06bf46a Fixes issue #149 --- diff --git a/AUTHORS b/AUTHORS index ff3acc0..47f7da0 100644 --- a/AUTHORS +++ b/AUTHORS @@ -6,3 +6,5 @@ Arne Jensen (DarkDeviL) Bas Verhoeven (soczol) Tom Wesley (tomaw) Jason Hill (SecretAgent) +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):