Module _ssl
[hide private]
[frames] | no frames]

Module _ssl

Implementation module for SSL socket operations. See the socket module for documentation.

Functions [hide private]
 
RAND_add(string, entropy)
Mix string into the OpenSSL PRNG state.
bytes
RAND_egd(path)
Queries the entropy gather daemon (EGD) on socket path.
0 or 1
RAND_status()
Returns 1 if the OpenSSL PRNG has been seeded with enough data and 0 if not.
 
ssl(...)
ssl(socket, [keyfile, certfile]) -> sslobject
Variables [hide private]
  SSL_ERROR_EOF = 8
  SSL_ERROR_INVALID_ERROR_CODE = 9
  SSL_ERROR_SSL = 1
  SSL_ERROR_SYSCALL = 5
  SSL_ERROR_WANT_CONNECT = 7
  SSL_ERROR_WANT_READ = 2
  SSL_ERROR_WANT_WRITE = 3
  SSL_ERROR_WANT_X509_LOOKUP = 4
  SSL_ERROR_ZERO_RETURN = 6

Imports: SSLType, sslerror


Function Details [hide private]

RAND_add(string, entropy)

 

Mix string into the OpenSSL PRNG state. entropy (a float) is a lower bound on the entropy contained in string.

RAND_egd(path)

 

Queries the entropy gather daemon (EGD) on socket path. Returns number of bytes read. Raises socket.sslerror if connection to EGD fails or if it does provide enough data to seed PRNG.

Returns: bytes

RAND_status()

 

Returns 1 if the OpenSSL PRNG has been seeded with enough data and 0 if not. It is necessary to seed the PRNG with RAND_add() on some platforms before using the ssl() function.

Returns: 0 or 1