Bas Verhoeven (soczol) <bas@bserved.nl>
Tom Wesley (tomaw) <tom@tomaw.org>
Jason Hill (SecretAgent) <secrtagnt@gmail.com>
+anarcat
+
# 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/"
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
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):