3 Secure Servers🔗ℹ
Implements an SSL server through an underlying TCP listener.
The server is configured via
context, while the
reuse and
max_allow_wait arguments are as for
network.TCP.listen.
Call TCPListener.load_certificate_chain and
TCPListener.load_private_key to avoid a “no shared cipher”
error on accepting connections. The file whose path is
collect.file_path(~collect: "openssl", ~file: "test.pem") is a
suitable argument for both calls when testing. Since "test.pem"
is public, however, such a test configuration obviously provides no
security.
An SSL listener is a synchronizable event. It is
ready—with itself as its value—when the underlying TCP listener is
ready. At that point, however, accepting a connection with
ssl.Listener.accept may not complete immediately, because
further communication is needed to establish the connection.
An SSL listener implements Closeable, so it can be
used with Closeable.let.
Closes an SSL listener. Closing the listener means that no new
connections can be accepted, but existing connections can continue.
Analogous to
network.TCPListener.accept, accepts an SSL
client connection for a server’s listener.