]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - qwebirc/ircclient.py
add dynamic configuration support
[irc/quakenet/qwebirc.git] / qwebirc / ircclient.py
index f517430fccb5efe12919c5b4487d5c64458ba715..8e06eaed64799658e78cf3fa9c5b9612e95db2ee 100644 (file)
@@ -152,7 +152,11 @@ 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"):
+      from twisted.internet import ssl
+      reactor.connectSSL(config.IRCSERVER, config.SSLPORT, f, ssl.ClientContextFactory(), **tcpkwargs)
+    else:
+      reactor.connectTCP(config.IRCSERVER, config.IRCPORT, f, **tcpkwargs)
     return f
 
   def callback(result):