Skip to main content

Module ssl

Module ssl 

Source
Expand description

TLS — SSL_CTX, SSL, and SSL_SESSION wrappers.

§Types

TypeOwned / SharedDescription
SslCtxShared (Clone)TLS context — configuration, certs, keys
SslExclusivePer-connection TLS object
SslSessionShared (Clone)Resumable TLS session handle

§Protocol version

SSL_CTX_set_min_proto_version / SSL_CTX_set_max_proto_version are C macros that expand to SSL_CTX_ctrl(ctx, 123 / 124, version, NULL). This module calls SSL_CTX_ctrl directly since bindgen cannot expose C macros as functions.

§SNI hostname

SSL_set_tlsext_host_name is a C macro expanding to SSL_ctrl(s, 55, 0, name). Use Ssl::set_hostname to set the SNI extension.

§BIO ownership

SSL_set_bio transfers ownership of the supplied BIO* pointers to the SSL object. Ssl::set_bio_duplex accepts a single crate::bio::Bio for the common case where the same BIO serves as both read and write channel (e.g. the output of BIO_new_bio_pair).

Structs§

Ssl
Per-connection TLS object (SSL*).
SslCtx
TLS context (SSL_CTX*).
SslSession
A TLS session handle (SSL_SESSION*).
SslVerifyMode
Certificate verification mode flags.

Enums§

ShutdownResult
Result of Ssl::shutdown.
SslIoError
Error returned by non-blocking SSL I/O operations.
TlsVersion
TLS protocol version selector.