开发者

A decent SSL library for Python 2.5

开发者 https://www.devze.com 2022-12-21 18:25 出处:网络
I am tasked with migrating a server\'s networking from plain sockets to SSL in python 2.5, and I\'ve run into a snag. It seems that just about no SSL library out there fully implements the socket inte

I am tasked with migrating a server's networking from plain sockets to SSL in python 2.5, and I've run into a snag. It seems that just about no SSL library out there fully implements the socket interface, so the code we currently have can't be straight migrated.

Specifically, I can't seem to find a library that supports the 'setblocking' method (most of these are wrappers, so would it be terrible to just address the wrapped socket directly?) and most don't seem to treat the wrapped socket as a file-like device, so the crucial 'select' method won't wor开发者_运维技巧k (again, could I run select on the wrapped socket?).

(read, write, error) = select([socket], [socket], [], 0.2)

I have tried tlslite and M2Crypto so far, but neither seem to work transparently as sockets.

Any ideas would be appreciated.


How about this backport of Python 2.6's ssl module to Python 2.3+? It provides the same functionality described here, which appears to mean that it takes a normal socket.socket and wraps it in an SSL context.


pyOpenSSL seems to support setblocking().

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号