class BufferingTLSTransport(TLSMemoryBIOProtocol): (source)
Constructor: BufferingTLSTransport(factory, wrappedProtocol, _connectWrapped)
A TLS transport implemented by wrapping buffering around a TLSMemoryBIOProtocol
.
Doing many small writes directly to a OpenSSL.SSL.Connection
, as implemented in TLSMemoryBIOProtocol
, can add significant CPU and bandwidth overhead. Thus, even when writing is possible, small writes will get aggregated and written as a single write at the next reactor iteration.
Method | __init__ |
Undocumented |
Method | lose |
Send a TLS close alert and close the underlying connection. |
Method | write |
Write a sequence of application bytes by joining them into one string and passing them to write . |
Instance Variable | _aggregator |
Undocumented |
Inherited from TLSMemoryBIOProtocol
:
Method | abort |
Tear down TLS state so that if the connection is aborted mid-handshake we don't deliver any further data from the application. |
Method | connection |
Handle the possible repetition of calls to this method (due to either the underlying transport going away or due to an error at the TLS layer) and make sure the base implementation only gets invoked once. |
Method | data |
Deliver any received bytes to the receive BIO and then read and deliver to the application any application-level data which becomes available as a result of this. |
Method | fail |
Abort the connection during connection setup, giving a reason that certificate verification failed. |
Method | get |
Return the OpenSSL.SSL.Connection object being used to encrypt and decrypt this connection. |
Method | get |
Return an object with the peer's certificate info. |
Method | make |
Connect this wrapper to the given transport and initialize the necessary OpenSSL.SSL.Connection with a memory BIO. |
Method | register |
Undocumented |
Method | unregister |
Undocumented |
Method | write |
Process the given application bytes and send any resulting TLS traffic which arrives in the send BIO. |
Instance Variable | connected |
Undocumented |
Instance Variable | disconnecting |
Undocumented |
Property | negotiated |
No summary |
Method | _buffered |
Put the given octets into TLSMemoryBIOProtocol._appSendBuffer , and tell any listening producer that it should pause because we are now buffering. |
Method | _check |
Ask OpenSSL to proceed with a handshake in progress. |
Method | _flush |
Try to receive any application-level bytes which are now available because of a previous write into the receive BIO. This will take care of delivering any application-level bytes which are received to the protocol, as well as handling of the various exceptions which can come from trying to get such bytes. |
Method | _flush |
Read any bytes out of the send BIO and write them to the underlying transport. |
Method | _shutdown |
Initiate, or reply to, the shutdown handshake of the TLS layer. |
Method | _tls |
Called when TLS connection has gone away; tell underlying transport to disconnect. |
Method | _unbuffer |
Un-buffer all waiting writes in TLSMemoryBIOProtocol._appSendBuffer . |
Method | _write |
Process the given application bytes and send any resulting TLS traffic which arrives in the send BIO. |
Instance Variable | _aborted |
abortConnection has been called. No further data will be received to the wrapped protocol's dataReceived. |
Instance Variable | _app |
application-level (cleartext) data that is waiting to be transferred to the TLS buffer, but can't be because the TLS connection is handshaking. |
Instance Variable | _connect |
A flag indicating whether or not to call makeConnection on the wrapped protocol. This is for the reactor's twisted.internet.interfaces.ITLSTransport.startTLS implementation, since it has a protocol which it has already called ... |
Instance Variable | _handshake |
A flag indicating whether or not the handshake is known to have completed successfully (True) or not (False). This is used to control error reporting behavior. If the handshake has not completed, the underlying ... |
Instance Variable | _lost |
A flag indicating whether connection loss has already been dealt with (True) or not (False). TLS disconnection is distinct from the underlying connection being lost. |
Instance Variable | _producer |
The current producer registered via registerProducer, or None if no producer has been registered or a previous one was unregistered. |
Instance Variable | _producer |
Undocumented |
Instance Variable | _reason |
If an unexpected OpenSSL.SSL.Error occurs which causes the connection to be lost, it is saved here. If appropriate, this may be used as the reason passed to the application protocol's connectionLost method. |
Instance Variable | _tls |
The OpenSSL.SSL.Connection instance which is encrypted and decrypting this connection. |
Inherited from ProtocolWrapper
(via TLSMemoryBIOProtocol
):
Method | __getattr__ |
Undocumented |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | log |
Use a customized log prefix mentioning both the wrapped protocol and the current one. |
Method | stop |
Undocumented |
Instance Variable | factory |
The WrappingFactory which created this ProtocolWrapper . |
Instance Variable | wrapped |
An IProtocol provider to which IProtocol method calls onto this ProtocolWrapper will be proxied. |
Inherited from BaseProtocol
(via TLSMemoryBIOProtocol
, ProtocolWrapper
, Protocol
):
Method | connection |
Called when a connection is made. |
Instance Variable | transport |
Undocumented |