von / PerProxy

A python-based proxy that uses Perspectives to detect and thwart SSL MITM attacks.
7 stars 2 forks source link

Sort our None and zero length reads from M2Crypto.SSL.Connection #12

Closed von closed 13 years ago

von commented 13 years ago

I think this is some quirk of the M2Crypto package, but a bunch of 0 byte reads seem to be how.

I think however a single zero read doesn't necessarily indicate an EOF.

Thread-28:Handler: Reading from server ...repeated many times... Thread-28:Handler: Reading from server Thread-28:Handler: Reading from server Thread-28:Handler: Reading from client Thread-28:Handler: Got EOF from client Thread-28:Handler: Pass through done. Thread-28:Handler: Done.

von commented 13 years ago

This also causes PerProxy to use CPU in a big way. Making PerProxy unusable currently.

von commented 13 years ago

New understanding: I believe reads from M2Crypto.SSL.Connection will return a 0-length buffer on EOF, but it may also return None spuriously, without meaning.

von commented 13 years ago

Apparently M2Crypto.Connection.recv() returning None is a known problem, see http://irmen.home.xs4all.nl/pyro3/troubleshooting.html

von commented 13 years ago

Looks like the None read problem is cause of CPU run-away: https://github.com/von/PerProxy/issues/25