from OpenSSL import SSL _ssl = SSL del SSL import threading _RLock = threading.RLock del threading class Connection: def __init__(self, *args): self._ssl_conn = apply(_ssl.Connection, args) self._lock = _RLock() for f in ('get_context', 'pending', 'send', 'write', 'recv', 'read', 'renegotiate', 'bind', 'listen', 'connect', 'accept', 'setblocking', 'fileno', 'shutdown', 'close', 'get_cipher_list', 'getpeername', 'getsockname', 'getsockopt', 'setsockopt', 'makefile', 'get_app_data', 'set_app_data', 'state_string', 'sock_shutdown', 'get_peer_certificate', 'get_peer_cert_chain', 'want_read', 'want_write', 'set_connect_state', 'set_accept_state', 'connect_ex', 'sendall'): exec("""def %s(self, *args): self._lock.acquire() try: return self._ssl_conn.%s(*args) finally: self._lock.release()\n""" % (f, f))
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
test | Folder | 0755 |
|
|
SSL.so | File | 67.02 KB | 0755 |
|
__init__.py | File | 965 B | 0644 |
|
__init__.pyc | File | 951 B | 0644 |
|
__init__.pyo | File | 951 B | 0644 |
|
crypto.so | File | 96.98 KB | 0755 |
|
rand.so | File | 13.13 KB | 0755 |
|
tsafe.py | File | 1010 B | 0644 |
|
tsafe.pyc | File | 1.62 KB | 0644 |
|
tsafe.pyo | File | 1.62 KB | 0644 |
|
version.py | File | 178 B | 0644 |
|
version.pyc | File | 255 B | 0644 |
|
version.pyo | File | 255 B | 0644 |
|