[Twisted-Python] failure to connect to sshsimpleserver.py
Glen Mabey
glen.mabey at swri.org
Tue Sep 23 17:58:48 EDT 2008
Hello,
I'm just starting to use twisted (having quickly read through the book
"Twisted: Network Programming Essentials"), and I am unable to
successfully use one of the example scripts: doc/conch/examples/
sshsimpleserver.py .
I am using python 2.5.2 and today's svn of twisted and pycrypto on
RedHat AS5 x84-64. I experienced similar results with 8.1.0 .
I am able to start the server with no problem, but when I start a
client that connects to it, I get:
2008-09-23 21:51:08+0000 [-] Log opened.
2008-09-23 21:51:08+0000 [-] __main__.ExampleFactory starting on 5022
2008-09-23 21:51:08+0000 [-] Starting factory <__main__.ExampleFactory
instance at 0x17e60a28>
2008-09-23 21:51:10+0000 [__main__.ExampleFactory] disabling diffie-
hellman-group-exchange because we cannot find moduli file
2008-09-23 21:51:10+0000 [SSHServerTransport,0,127.0.0.1] kex alg, key
alg: diffie-hellman-group1-sha1 ssh-rsa
2008-09-23 21:51:10+0000 [SSHServerTransport,0,127.0.0.1] outgoing:
aes256-ctr hmac-sha1 none
2008-09-23 21:51:10+0000 [SSHServerTransport,0,127.0.0.1] incoming:
aes256-ctr hmac-sha1 none
2008-09-23 21:51:10+0000 [SSHServerTransport,0,127.0.0.1] Unhandled
Error
Traceback (most recent call last):
File "/usr/DiamondBack/stow/twisted-20080923_svn-py2.5/lib/
python2.5/site-packages/twisted/python/log.py", line 51, in
callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/usr/DiamondBack/stow/twisted-20080923_svn-py2.5/lib/
python2.5/site-packages/twisted/python/log.py", line 36, in
callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/DiamondBack/stow/twisted-20080923_svn-py2.5/lib/
python2.5/site-packages/twisted/python/context.py", line 59, in
callWithContext
return self.currentContext().callWithContext(ctx, func, *args,
**kw)
File "/usr/DiamondBack/stow/twisted-20080923_svn-py2.5/lib/
python2.5/site-packages/twisted/python/context.py", line 37, in
callWithContext
return func(*args,**kw)
--- <exception caught here> ---
File "/usr/DiamondBack/stow/twisted-20080923_svn-py2.5/lib/
python2.5/site-packages/twisted/internet/selectreactor.py", line 146,
in _doReadOrWrite
why = getattr(selectable, method)()
File "/usr/DiamondBack/stow/twisted-20080923_svn-py2.5/lib/
python2.5/site-packages/twisted/internet/tcp.py", line 463, in doRead
return self.protocol.dataReceived(data)
File "/usr/DiamondBack/stow/twisted-20080923_svn-py2.5/lib/
python2.5/site-packages/twisted/conch/ssh/transport.py", line 314, in
dataReceived
self.dispatchMessage(messageNum, packet[1:])
File "/usr/DiamondBack/stow/twisted-20080923_svn-py2.5/lib/
python2.5/site-packages/twisted/conch/ssh/transport.py", line 329, in
dispatchMessage
f(payload)
File "/usr/DiamondBack/stow/twisted-20080923_svn-py2.5/lib/
python2.5/site-packages/twisted/conch/ssh/transport.py", line 740, in
ssh_KEX_DH_GEX_REQUEST_OLD
NS(self.factory.privateKeys[self.keyAlg].sign(exchangeHash)))
File "/usr/DiamondBack/stow/twisted-20080923_svn-py2.5/lib/
python2.5/site-packages/twisted/conch/ssh/keys.py", line 659, in sign
signature = self.keyObject.sign(digest, '')[0]
File "/usr/DiamondBack/stow/pycrypto-20080923_git-py2.5/lib/
python2.5/site-packages/Crypto/PublicKey/pubkey.py", line 76, in sign
return self._sign(M, K)
exceptions.TypeError: _sign() takes exactly 2 arguments (3 given)
2008-09-23 21:51:10+0000 [SSHServerTransport,0,127.0.0.1] connection
lost
I have tried starting the client both as 'ssh localhost -p 5022' as
well as running the sshsimpleclient.py script with the same results.
I have also tried connecting from a different host into the server,
with the same results.
Any help in resolving this issue and realizing a working example of an
ssh server would be greatly appreciated.
Thank you,
Glen Mabey
More information about the Twisted-Python
mailing list