Method SSL.File()->connect()

class SSL.File

Method connect

SSL.Session|zero connect(string|void dest_addr, SSL.Session|void session, string(8bit)|void early_data)

Description

Configure as client and set up the connection.

Parameter dest_addr

Optional name of the server that we are connected to.

Parameter session

Session to resume (if any).

Parameter early_data

TLS 1.3 (RFC 8446 section 2.3) 0-RTT application data to send immediately, opportunistically -- see ClientConnection.client_hello()'s parameter doc for exactly when this is (and isn't) actually sent as 0-RTT. Whether it was sent/accepted is reachable via query_connection()->early_data_sent_1_3/ early_data_accepted_1_3 -- no dedicated accessor here.

Returns

Returns 0 on handshaking failure in blocking mode, and otherwise the Session object for the connection.

Throws

Throws an error if a connection already has been established.

See also

accept()