Fixed IRC SSL implementation to handle a non-installed openssl library.
This commit is contained in:
parent
8f1378c47e
commit
bdd229afb4
1 changed files with 2 additions and 2 deletions
|
|
@ -9,7 +9,7 @@ from future.utils import viewkeys
|
||||||
import re
|
import re
|
||||||
from twisted.application import internet
|
from twisted.application import internet
|
||||||
from twisted.words.protocols import irc
|
from twisted.words.protocols import irc
|
||||||
from twisted.internet import protocol, reactor, ssl
|
from twisted.internet import protocol, reactor
|
||||||
from evennia.server.session import Session
|
from evennia.server.session import Session
|
||||||
from evennia.utils import logger, utils
|
from evennia.utils import logger, utils
|
||||||
|
|
||||||
|
|
@ -313,7 +313,7 @@ class IRCBotFactory(protocol.ReconnectingClientFactory):
|
||||||
if self.port:
|
if self.port:
|
||||||
if ssl:
|
if ssl:
|
||||||
try:
|
try:
|
||||||
import OpenSSL
|
from twisted.internet import ssl
|
||||||
service = reactor.connectSSL(self.network, int(self.port), self, ssl.ClientContextFactory())
|
service = reactor.connectSSL(self.network, int(self.port), self, ssl.ClientContextFactory())
|
||||||
except ImportError:
|
except ImportError:
|
||||||
self.caller.msg("To use SSL, the PyOpenSSL module must be installed.")
|
self.caller.msg("To use SSL, the PyOpenSSL module must be installed.")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue