Expand description
A tiny utility library for making TLS connectors.
Macros§
Structs§
- Make
Rustls Connect - A
MakeTlsConnectbacked by rustls. - NoVerifier 🔒
- Accepts any server certificate, as openssl does with
SslVerifyMode::NONE. Handshake signatures are still checked against the presented certificate’s key. - Pkcs12
Archive - Postgres
Server 🔒Verifier - Verifies the server’s certificate chain, and its hostname when
verify_hostnameis set, accepting the certificate shapes that the openssl connector accepts and webpki rejects. - Rustls
Connect - A
TlsConnectfor one server, created byMakeRustlsConnect. - Rustls
TlsStream - 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-probeandrustls-native-certs.
Functions§
- check_
validity 🔒 - Checks the validity period of a certificate that bypasses webpki.
- common_
name_ 🔒matches - Whether
server_nameexactly 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
certhas 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
pathin 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 asmake_tlsdoes for eachsslmode. - merge_
trust_ 🔒bundles - Encodes the
systemcertificates followed by the PEM certificates inadditionalas 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-pointchannel 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.