Skip to main content

Crate mz_tls_util

Crate mz_tls_util 

Source
Expand description

A tiny utility library for making TLS connectors.

Macros§

bail_generic 🔒

Structs§

MakeRustlsConnect
A MakeTlsConnect backed by rustls.
NoVerifier 🔒
Accepts any server certificate, as openssl does with SslVerifyMode::NONE. Handshake signatures are still checked against the presented certificate’s key.
Pkcs12Archive
PostgresServerVerifier 🔒
Verifies the server’s certificate chain, and its hostname when verify_hostname is set, accepting the certificate shapes that the openssl connector accepts and webpki rejects.
RustlsConnect
A TlsConnect for one server, created by MakeRustlsConnect.
RustlsTlsStream
A rustls client stream that implements TlsStream.

Enums§

TlsError
An error representing tls failures.

Constants§

SSL_CERT_FILE
The environment variable that names the CA bundle trusted by OpenSSL’s default verify paths, openssl-probe and rustls-native-certs.

Functions§

check_validity 🔒
Checks the validity period of a certificate that bypasses webpki.
common_name_matches 🔒
Whether server_name exactly matches the certificate’s subject CN, which OpenSSL checks when the certificate has no DNS subjectAltName. Wildcard CNs are not matched.
has_name_constraints 🔒
Whether cert has a nameConstraints extension. Unparseable certificates count as constrained.
install_additional_trust_bundle⚠
Makes TLS clients in this process trust the PEM-encoded CA certificates in path in addition to the system’s CAs, and returns the path of the merged bundle.
make_tls
Creates a TLS connector for the given Config.
make_tls_rustls
Creates a rustls TLS connector for the given Config, verifying the server as make_tls does for each sslmode.
merge_trust_bundles 🔒
Encodes the system certificates followed by the PEM certificates in additional as one PEM bundle.
pkcs12der_from_pem
Constructs an identity from a PEM-formatted key and certificate using OpenSSL.
tls_server_end_point 🔒
Computes the RFC 5929 tls-server-end-point channel binding for a DER server certificate: its hash under the hash function of its signature algorithm, with MD5 and SHA-1 upgraded to SHA-256.