Menu

#13 SSL function deprecated

Unstable_(example)
closed
nobody
None
5
2012-09-29
2010-04-08
Uakh
No

When running irclib on python 2.6 with ssl=True I get the following warning :

irclib.py:435: DeprecationWarning: socket.ssl() is deprecated. Use ssl.wrap_socket() instead.
self.ssl = socket.ssl(self.socket)

I accordingly changed socket.ssl(self.socket) to ssl.wrap_socket(self.socket)
However doing this caused an error:

AttributeError: 'bool' object has no attribute 'wrap_socket'

I figured it was because of the parameter variable ssl (boolean) which is used in the connect() function. I renamed the parameter to usessl and then everything was working as it should. I pastebined the code at

http://pastebin.com/kWqPv4fj

with modified lines highlighted. Only problem I am concerned with is that doing this fixes the deprecation problem, but in turn breaks compatibility with existing SSL enabled applications using irclib unless they do a minor edit of their code (basically using parameter usessl instead of ssl), so you will have to either keep using the deprecated function, or warn people updating of this, or find a better way of achieving this (I didn't bother searching much, all I wanted was my app to work).

Discussion

  • Doctor Infierno

    Doctor Infierno - 2010-04-29

    try renaming the ssl module.

    something like:

    import ssl as ssl_module

    .....

    ssl_module.wrap_socket(....

     
  • Jeff Huang

    Jeff Huang - 2010-04-30

    Thanks! I will fix this shortly.

     
  • Doctor Infierno

    Doctor Infierno - 2010-04-30

    Thanks to you, Jeff.

    .peter

     
  • Jason R. Coombs

    Jason R. Coombs - 2012-09-29

    This is no longer an issue.

     
  • Jason R. Coombs

    Jason R. Coombs - 2012-09-29
    • status: open --> closed
    • milestone: --> Unstable_(example)
     

Anonymous
Anonymous

Add attachments
Cancel