Class SSL.Connection

Inheritance graph
Description

SSL.Connection keeps the state relevant for a single SSL connection. This includes the Context object (which doesn't change), various buffers, the Session object (reused or created as appropriate), and pending read and write states being negotiated.

Each connection will have two sets of read and write States: The current read and write states used for encryption, and pending read and write states to be taken into use when the current keyexchange handshake is finished.

This object is also responsible for managing incoming and outgoing packets. Outgoing packets are stored in queue objects and sent in priority order.

Note

This class should never be created directly, instead one of the classes that inherits it should be used (ie either ClientConnection or ServerConnection) depending on whether this is to be a client-side or server-side connection. These in turn are typically created by File()->create().

See also

ClientConnection, ServerConnection, Context, Session, File, State


Constant window_size

private constant int SSL.Connection.window_size

Description

Number of passed sequence numbers to keep track of. RFC 4347 section 4.1.2.5: A minimum window size of 32 MUST be supported, but a window size of 64 is preferred and SHOULD be employed as the default. Another window size (larger than the minimum) MAY be chosen by the receiver.


Variable application_protocol

string(8bit)|zero SSL.Connection.application_protocol

Description

Selected ALPN (RFC 7301) protocol (if any).

Note

Note that this is a connection property, and needs to be renegotiated on session resumption.


Variable client_random
Variable server_random

string(8bit)|zero SSL.Connection.client_random
string(8bit)|zero SSL.Connection.server_random

Description

Random cookies, sent and received with the hello-messages.


Variable ke

.Cipher.KeyExchange|zero SSL.Connection.ke

Description

The active Cipher.KeyExchange (if any).


Variable sent

int|zero SSL.Connection.sent

Description

Number of application data bytes sent by us.


Variable sequence_mask

private int SSL.Connection.sequence_mask

Description

Bitmask representing sequence numbers for accepted received packets in the interval [next_seq_num-window_size..next_seq_num-2].

Note

The packet with seqence number next_seq_num-1 is implicitly known to have been received.


Variable state

ConnectionState SSL.Connection.state

Description

Bitfield with the current connection state.


Method create

SSL.Connection SSL.Connection(Context ctx)

Description

Initialize the connection state.

Parameter ctx

The context for the connection.