Home | Trees | Index | Help |
---|
Package tlslite :: Module TLSRecordLayer :: Class TLSRecordLayer |
|
TLSConnection
This class handles data transmission for a TLS connection.
Its only subclass istlslite.TLSConnection.TLSConnection
. We've
separated the code in this class from TLSConnection to make things more
readable.
Method Summary | |
---|---|
__init__(self,
sock)
| |
str |
Read some data from the TLS connection. |
iterable |
Start a read operation on the TLS connection. |
Write some data to the TLS connection. | |
iterable |
Start a write operation on the TLS connection. |
Close the TLS connection. | |
iterable |
Start a close operation on the TLS connection. |
str |
Get the name of the cipher implementation used with this connection. |
str |
Get the name of the cipher used with this connection. |
Return the remote address to which the socket is connected (socket emulation). | |
Return the socket's own address (socket emulation). | |
Return the timeout associated with socket operations (socket emulation). | |
tlslite.FileObject.FileObject
|
Create a file object for the TLS connection (socket emulation). |
Get some data from the TLS connection (socket emulation). | |
Send data to the TLS connection (socket emulation). | |
Send data to the TLS connection (socket emulation). | |
Set the value of the given socket option (socket emulation). | |
Set a timeout on blocking socket operations (socket emulation). | |
_calcFinished(self,
send)
| |
_calcPendingStates(self,
clientRandom,
serverRandom,
implementations)
| |
_calcSSLHandshakeHash(self,
masterSecret,
label)
| |
_changeReadState(self)
| |
_changeWriteState(self)
| |
_decrefAsync(self)
| |
_decryptRecord(self,
recordType,
bytes)
| |
_getFinished(self)
| |
_getMsg(self,
expectedType,
secondaryType,
constructorType)
| |
_getNextRecord(self)
| |
_handshakeDone(self,
resumed)
| |
_handshakeStart(self,
client)
| |
_sendError(self,
alertDescription,
errorStr)
| |
_sendFinished(self)
| |
_sendMsg(self,
msg,
skipEmptyFrag)
| |
_sendMsgs(self,
msgs)
| |
_shutdown(self,
resumable)
|
Instance Variable Summary | |
---|---|
str or None | allegedSharedKeyUsername : This is set to the shared-key username asserted by the client, whether
the handshake succeeded or not. |
str or None | allegedSrpUsername : This is set to the SRP username asserted by the client, whether the
handshake succeeded or not. |
bool | closed : If this connection is closed. |
bool | closeSocket : If the socket should be closed when the connection is closed
(writable). |
bool | ignoreAbruptClose : If an abrupt close of the socket should raise an error (writable). |
bool | resumed : If this connection is based on a resumed session. |
tlslite.Session.Session |
session : The session corresponding to this connection. |
socket.socket | sock : The underlying socket object. |
tuple | version : The TLS version being used for this connection. |
Method Details |
---|
read(self, max=None, min=1)Read some data from the TLS connection. This function will block until at least 'min' bytes are available (or the connection is closed). If an exception is raised, the connection will have been automatically closed.
|
readAsync(self, max=None, min=1)Start a read operation on the TLS connection. This function returns a generator which behaves similarly to read(). Successive invocations of the generator will return 0 if it is waiting to read from the socket, 1 if it is waiting to write to the socket, or a string if the read operation has completed.
|
write(self, s)Write some data to the TLS connection. This function will block until all the data has been sent. If an exception is raised, the connection will have been automatically closed.
|
writeAsync(self, s)Start a write operation on the TLS connection. This function returns a generator which behaves similarly to write(). Successive invocations of the generator will return 1 if it is waiting to write to the socket, or will raise StopIteration if the write operation has completed.
|
close(self)Close the TLS connection. This function will block until it has exchanged close_notify alerts with the other party. After doing so, it will shut down the TLS connection. Further attempts to read through this connection will return "". Further attempts to write through this connection will raise ValueError. If makefile() has been called on this connection, the connection will be not be closed until the connection object and all file objects have been closed. Even if an exception is raised, the connection will have been closed.
|
closeAsync(self)Start a close operation on the TLS connection. This function returns a generator which behaves similarly to close(). Successive invocations of the generator will return 0 if it is waiting to read from the socket, 1 if it is waiting to write to the socket, or will raise StopIteration if the close operation has completed.
|
getCipherImplementation(self)Get the name of the cipher implementation used with this connection.
|
getCipherName(self)Get the name of the cipher used with this connection.
|
getpeername(self)Return the remote address to which the socket is connected (socket emulation). |
getsockname(self)Return the socket's own address (socket emulation). |
gettimeout(self)Return the timeout associated with socket operations (socket emulation). |
makefile(self, mode='r', bufsize=-1)Create a file object for the TLS connection (socket emulation).
|
recv(self, bufsize)Get some data from the TLS connection (socket emulation).
|
send(self, s)Send data to the TLS connection (socket emulation).
|
sendall(self, s)Send data to the TLS connection (socket emulation).
|
setsockopt(self, level, optname, value)Set the value of the given socket option (socket emulation). |
settimeout(self, value)Set a timeout on blocking socket operations (socket emulation). |
Instance Variable Details |
---|
closedIf this connection is closed.
|
ignoreAbruptCloseIf an abrupt close of the socket should raise an error (writable). If you set this to True, TLS Lite will not raise a
|
resumedIf this connection is based on a resumed session.
|
sessionThe session corresponding to this connection. Due to TLS session resumption, multiple connections can correspond to the same underlying session.
|
sockThe underlying socket object.
|
versionThe TLS version being used for this connection. (3,0) means SSL 3.0, and (3,1) means TLS 1.0.
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.0 on Sun Mar 21 00:04:59 2004 | http://epydoc.sf.net |