You are not logged in.

#1 2011-04-12 19:27:59

codename_B
Member
Registered: 2011-04-11
Posts: 5

Python - changing socket.ssl() to ssl.wrap_socket() in pebrot

Hey,

I'm having issues changing the code in pebrot to be up to date - I'd really appreciate help bringing this jewel of an msn client to the latest version of python. Anyone who can fix this for me - and the whole community - I will happily send you $10 paypal if you like!

Enough trying to garner support, here's my attempt, just to prove I've not given up and am calling on you because I can't be bothered trying...

My code

    def sslSendRecv( self, host, port, st ):
        sock= socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        sock.connect( (host, port) )
        ssl_sock= ssl.wrap_socket( sock )
#        ssl_sock= socket.ssl( sock )
        self.pDebug( 'request: ' + st )
        ssl_sock.write( st )
        self.pDebug( 'AFTER SEND' )
    
        recv= ''
        try:
            while (1):
                recv+= ssl_sock.read()
        except socket.sslerror, e:
            if e[0] not in [5,8]:
                raise e
        
        return recv

Original code

    def sslSendRecv( self, host, port, st ):
        sock= socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        sock.connect( (host, port) )
        ssl= socket.ssl( sock )
        self.pDebug( 'request: ' + st )
        ssl.write( st )
        self.pDebug( 'AFTER SEND' )
    
        recv= ''
        try:
            while (1):
                recv+= ssl.read()
        except socket.sslerror, e:
            if e[0] not in [5,8]:
                raise e
        
        return recv

Can anyone help? smile

The sourceforge page for pebrot is here
http://pebrot.sourceforge.net/

Offline

#2 2011-04-16 10:30:13

codename_B
Member
Registered: 2011-04-11
Posts: 5

Re: Python - changing socket.ssl() to ssl.wrap_socket() in pebrot

I'd be stupidly grateful if anyone could even have a try at this for me smile

Offline

Board footer

Powered by FluxBB