Fix SSL issues caused by redundant patches.

This commit is contained in:
Valentin Lorentz 2012-04-03 17:14:07 +02:00
parent e92b8a62f5
commit 2432df156d
2 changed files with 3 additions and 16 deletions

View File

@ -41,6 +41,8 @@ try:
import ssl import ssl
SSLError = ssl.SSLError SSLError = ssl.SSLError
except: except:
drivers.log.debug('ssl module is not available, '
'cannot connect to SSL servers.')
class SSLError(Exception): class SSLError(Exception):
pass pass
@ -52,13 +54,6 @@ import supybot.drivers as drivers
import supybot.schedule as schedule import supybot.schedule as schedule
from supybot.utils.iter import imap from supybot.utils.iter import imap
try:
import ssl
except ImportError:
drivers.log.debug('ssl module is not available, '
'cannot connect to SSL servers.')
ssl = None
class SocketDriver(drivers.IrcDriver, drivers.ServersMixin): class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
def __init__(self, irc): def __init__(self, irc):
self.irc = irc self.irc = irc
@ -183,14 +178,6 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
drivers.log.connect(self.currentServer) drivers.log.connect(self.currentServer)
try: try:
self.conn = utils.net.getSocket(server[0]) self.conn = utils.net.getSocket(server[0])
if self.networkGroup.get('ssl').value:
if ssl:
self.plainconn = self.conn
self.conn = ssl.wrap_socket(self.conn)
else:
drivers.log.error('ssl module not available, '
'cannot connect to SSL servers.')
return
vhost = conf.supybot.protocols.irc.vhost() vhost = conf.supybot.protocols.irc.vhost()
self.conn.bind((vhost, 0)) self.conn.bind((vhost, 0))
except socket.error, e: except socket.error, e:

View File

@ -1,3 +1,3 @@
"""stick the various versioning attributes in here, so we only have to change """stick the various versioning attributes in here, so we only have to change
them once.""" them once."""
version = '0.83.4.1+limnoria (2012-04-03T14:55:29+0000)' version = '0.83.4.1+limnoria (2012-04-03T15:14:07+0000)'