All Manuals > LispWorks® User Guide and Reference Manual > 32 The COMM Package

async-io-state-attach-ssl Function

Summary

Attaches SSL to an async-io-state that contains a TCP socket.

Package

comm

Signature

async-io-state-attach-ssl async-io-state callback &key ssl-side ssl-ctx ctx-configure-callback ssl-configure-callback handshake-timeout tlsext-host-name

Arguments
async-io-state
callback
A function designator for a function with two arguments.
ssl-side
One of the keywords :client, :server or :both.
ssl-ctx
A symbol or a foreign pointer.
ctx-configure-callback
A function designator or nil. The default value is nil.
ssl-configure-callback
A function designator or nil. The default value is nil.
handshake-timeout
A real or nil (the default).
tlsext-host-name
A string or nil.
Description

The function async-io-state-attach-ssl attaches SSL to async-io-state, which must contain a TCP socket, typically the result of create-async-io-state or a state created by accept-tcp-connections-creating-async-io-states. async-io-state must not have SSL attached to it already.

ssl-side, ssl-ctx, ctx-configure-callback, ssl-configure-callback and handshake-timeout are interpreted as described in 25.8.6 Keyword arguments for use with SSL. ssl-ctx defaults to t and ssl-side defaults to :server.

When SSL has been attached successfully or otherwise, callback is called with two arguments: async-io-state and an error-indicator. The error-indicator is nil when successful, otherwise it is a list of a format control-string and args, suitable for applying to format. When the error-indicator is non-nil, async-io-state is not attached to SSL.

async-io-state-attach-ssl must not be called when there is any other operation on async-io-state and new operations on async-io-state must not be started before callback has been called.

If tlsext-host-name is non-nil, then the SNI extension in the SSL connection is set to its value.

Notes

create-async-io-state-and-connected-tcp-socket and accept-tcp-connections-creating-async-io-states can attach SSL themselves, and in most cases that is the best way to do it. async-io-state-attach-ssl allows the attachment to be done later.

See also

create-async-io-state-and-connected-tcp-socket
accept-tcp-connections-creating-async-io-states
async-io-state-detach-ssl
25.8.5 Using Asynchronous I/O with SSL
25 TCP and UDP socket communication and SSL


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:26