abla/websocket/server/tls

Generated from source.

Import with import "abla/websocket/server/tls".

Source: abla/websocket/server/tls/entry.ab

WebSocketServerTlsEntry (class)

class WebSocketServerTlsEntry(val id: int, val config: TlsServerConfig, var references: int)

The configurations, by the id the WebSocketServerTls carries as its context, with their reference counts; and the sessions, by the descriptor they run over plus one (0 is "no session"). One event loop drives them.

webSocketServerTlsConfigs (val)

val webSocketServerTlsConfigs: array<WebSocketServerTlsEntry>

Holds TLS server configurations and their reference counts.

webSocketServerTlsSessions (val)

val webSocketServerTlsSessions: array<TlsServerSession>

Holds active TLS sessions in the same order as their handles.

webSocketServerTlsHandles (val)

val webSocketServerTlsHandles: array<int>

Holds the descriptor-based handles indexing the active TLS sessions.

webSocketServerTlsNextId (var)

var webSocketServerTlsNextId

Holds the next ID to assign to a server TLS configuration.

webSocketServerTls (fun)

fun webSocketServerTls(
    certificatePath: string,
    privateKeyPath: string,
    handshakeTimeoutMilliseconds: int = 5000
): WebSocketServerTls

Reads a certificate chain (leaf first) and its private key from PEM files, such as an ACME client's fullchain.pem and privkey.pem.

webSocketServerTlsPem (fun)

fun webSocketServerTlsPem(
    certificatePem: string,
    privateKeyPem: string,
    handshakeTimeoutMilliseconds: int = 5000
): WebSocketServerTls

Same, from PEM text already in memory.

webSocketServerTlsPems (fun)

fun webSocketServerTlsPems(
    entries: array<TlsServerPem>,
    handshakeTimeoutMilliseconds: int = 5000
): WebSocketServerTls

As webSocketServerTlsPem for a server with several certificates, chosen by the client's server name (SNI) and signature algorithms (tlsServerConfigFromPems: the first entry is the default, a name's ECDSA entry before its RSA one).

webSocketServerTlsStatus (fun)

fun webSocketServerTlsStatus(status: int, failure: int): int

1 progress or done, 2 wants the socket readable, 3 writable: the TLS_IO statuses as the server's wait values.

webSocketServerTlsStart (fun)

fun webSocketServerTlsStart(context: int, descriptor: int): int

Starts a TLS session on the descriptor and returns its handle, or zero on failure.

webSocketServerTlsHandshake (fun)

fun webSocketServerTlsHandshake(session: int): int

Advances the handshake and returns success, a readiness request or a negative failure status.

webSocketServerTlsRead (fun)

fun webSocketServerTlsRead(session: int, var result: SocketReceiveResult): void

Fills the output with readable bytes or a status for EOF, required readiness or failure.

webSocketServerTlsWrite (fun)

fun webSocketServerTlsWrite(session: int, contents: string, offset: int): int

Writes at most one record. A retry after a pending write passes the same bytes at the same offset.

webSocketServerTlsPending (fun)

fun webSocketServerTlsPending(session: int): bool

Returns whether the session already has bytes buffered for a read.

webSocketServerTlsFree (fun)

fun webSocketServerTlsFree(session: int, notify: bool): void

With notify close_notify is offered once; the server closes the socket itself.

webSocketServerTlsRetain (fun)

fun webSocketServerTlsRetain(context: int): bool

Increases the configuration's reference count and returns false for an unknown context.

webSocketServerTlsRelease (fun)

fun webSocketServerTlsRelease(context: int): void

The last reference clears the private key.

Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.