SSL¶
An SSL session manages handshakes, encryption and decryption. It is not tied to any transport layer.
Public Functions¶
alpn_selected¶
Get the protocol identifier negotiated via ALPN
Returns¶
state¶
Returns the SSL session state.
Returns¶
- (SSLHandshake val | SSLAuthFail val | SSLReady val | SSLError val)
read¶
Returns unencrypted bytes to be passed to the application. If expect
is
non-zero, the number of bytes returned will be exactly expect
. If no data
(or less than expect
bytes) is available, this returns None.
Parameters¶
- expect: USize val = 0
Returns¶
write¶
When application data is sent, add it to the SSL session. Raises an error if the handshake is not complete.
Parameters¶
Returns¶
- None val ?
receive¶
When data is received, add it to the SSL session.
Parameters¶
Returns¶
- None val
can_send¶
Returns true if there are encrypted bytes to be passed to the destination.
Returns¶
- Bool val
send¶
Returns encrypted bytes to be passed to the destination. Raises an error if no data is available.
Returns¶
dispose¶
Dispose of the session.
Returns¶
- None val