[Twisted-Python] PB and hashed passwords

Justin Johnson justinjohnson at fastmail.fm
Fri Apr 23 08:49:16 EDT 2004

I got PB over SSL working by installing OpenSSL and pyOpenSSL, generating
my own pem by following the instructions at
and adding the following code on the server-side.

from twisted.internet.ssl import DefaultOpenSSLContextFactory
from OpenSSL.SSL import SSLv23_METHOD

cf = os.path.join(sibpath(__file__, 'ssl'), 'ratcontrol.pem')
pf =  os.path.join(sibpath(__file__, 'ssl'), 'ratcontrol.pem')
sslFactory = DefaultOpenSSLContextFactory(cf, pf, SSLv23_METHOD)


    #svc = internet.TCPServer(config['pbport'], factory)
    svc = internet.SSLServer(config['pbport'], factory,

On the client-side I added the following.

from twisted.internet import ssl


    #reactor.connectTCP(server, config.pbPortNumber, factory)
    reactor.connectSSL(server, config.pbPortNumber, factory,

Of course I can't get any of this to work on Windows because there isn't
any reactor that supports SSL and spawnProcess.  :-(


On Fri, 23 Apr 2004 03:19:15 -0400, "Stephen Waterbury"
<golux at comcast.net> said:
> Uwe C. Schroeder wrote:
> > Would be nice to have ssh with pb :-) Has anyone written that yet ? (don't ask 
> > me to volunteer, i've got deadlines up to my neck)
> I'm sure it could be done, but you could also just use
> SSL.  There was a long thread about PB over SSL on the
> list on 4-5 August 2003.
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

More information about the Twisted-Python mailing list