1 Secure Ports
annotation | |
| |
| |
annotation | |
| |
| |
annotation | |
|
A pair of ssl.Ports is typically created by ssl.connect or ssl.Listener.accept, but ssl.Ports can also be created as a layer on existing ports via ssl.Port.from_ports.
function | |||||||||||||
| |||||||||||||
| |||||||||||||
enumeration | |||||||||||||
The mode argument determines whether the given in and out are wrapped to use the client (#'connect) or server (#'accept) half of the protocol.
The context argument configures properties of the connection, and the kind of context must be consistent with mode. See ssl.Context.Client and ssl.Context.Server for more information.
If hostname verification is enabled (see ssl.Context.set_verify_hostname), the peer’s certificate is checked against host.
A non-empty alpn_protocols argument is used in #'connect mode, in which case the client attempts to use ALPN; see also ssl.connect and ssl.Port.selected_alpn. If mode is #'accept, then alpn_protocols must be empty; use ssl.Context.Server.set_server_alpn to set the ALPN protocols for a server context.
If close_original is a true value, then in and out are closed when both of the returned ports are closed.
If shutdown_on_close is a true value, then when out is closed before in is closed, then a shutdown message is sent to the connection peer. Otherwise, an early close of out is not reported to the connection peer.
If an error is encountered during the protocol initialization, then exn is used to construct the exception that is raised. Supplying Exn.Fail.Network as exn might be useful, for example.
method | |||
|
The result list may contain both hostnames such as "www.racket-lang.org" and hostname patterns such as "*.racket-lang.org".
method | |
| |
| |
method | |
|
Use ssl.Port.peer_certificate_hostname or ssl.Port.peer_certificate_hostnames instead to check the validity of an SSL connection.
If a server does not support any of the protocols proposed by a client, it might reject the connection or it might accept the connection without selecting an application protocol. Always check the selected protocol after making a client connection.
method | ||
| ||
| ||
method | ||