Skip to main content

Module test_support

Module test_support 

Source
Expand description

Certificates for a test that needs a server a real client can verify.

Behind the test-support feature, so nothing ships it.

Every client in this workspace verifies what it connects to, and there is no way to switch that off — so a test that stands up a server over TLS has to hand its client an authority to trust. issue_for is that: a throwaway authority, a leaf under it, and the authority’s PEM to put in the client’s root store.

Separate from crate::local, which is a machine’s one authority kept on disk and trusted once. Nothing here touches disk or outlives the process.

Structs§

TestCertificate
A leaf, its key and the authority that signed it.

Functions§

issue_for
A fresh authority and a leaf covering names, which may be hostnames or address literals.
self_signed_pem
A self-signed certificate and its private key, both PEM, for name.
server_config
A rustls::ServerConfig covering names, and the authority a client has to trust to reach it.