On 01:31 pm, [email protected] wrote:
On Oct 2, 2013, at 9:20 AM, [email protected] wrote:
On 01:21 am, [email protected] wrote:
I have two pieces of code (see:
https://gist.github.com/dstufft/9dc9978dc0af77e82f0c) one "works" (in
that it fails verifying the host key like i'd expect) and one doesn't
("it never tries to verify the host key and just exists immediately).
I don't understand *why* though, why does the connectionReady dance
make it work?
Where's the second piece of code?
Jean-Paul
Both are in the gist, works.py and fails.py
Oops, sorry. The second one disappeared when I clicked the "raw" link I
guess.
In the first version, you `react` until `connectProtocol`'s Deferred
fires. That's immediately upon the TCP connection setup success -
before any appreciable SSH happens.
In the second version, you `react` indefinitely (because
`connectionReady` never fires) giving SSH ample time to handshake.
BTW, I'm not sure what you plan to do with this connection, but if you
haven't seen `twisted.conch.endpoints` (and <https://tm.tl/6617>) then
you probably want to look.
Jean-Paul
_______________________________________________
Twisted-Python mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python