This module handles things specific to SSL. There are two objects defined: Context, Connection.
method should be SSLv2_METHOD, SSLv3_METHOD, SSLv23_METHOD or TLSv1_METHOD.
context should be an instance of Context and socket should be a socket 3 object. socket may be None; in this case, the Connection is created with a memory BIO: see the bio_read, bio_write, and bio_shutdown methods.
Whenever this exception is raised directly, it has a list of error messages
from the OpenSSL error queue, where each item is a tuple (lib,
function, reason)
. Here lib, function and reason
are all strings, describing where and what the problem is. See err(3)
for more information.
SSL_ERROR_ZERO_RETURN
, and
is raised when the SSL Connection has been closed. In SSL 3.0 and TLS 1.0, this
only occurs if a closure alert has occurred in the protocol, i.e. the
connection has been closed cleanly. Note that this does not necessarily
mean that the transport layer (e.g. a socket) has been closed.
It may seem a little strange that this is an exception, but it does match an
SSL_ERROR
code, and is very convenient.
The wanted read is for dirty data sent over the network, not the clean data inside the tunnel. For a socket based SSL connection, read means data coming at us over the network. Until that read succeeds, the attempted OpenSSL.SSL.Connection.recv, OpenSSL.SSL.Connection.send, or OpenSSL.SSL.Connection.do_handshake is prevented or incomplete. You probably want to select() on the socket before trying again.
(errnum,
errstr)
.