oa_gateway_adapter::tls

Function server_tls_from_pem

Source
pub fn server_tls_from_pem(
    key_prefix: &str,
    cert_pem: &[u8],
    key_pem: &[u8],
    client_ca_pem: Option<&[u8]>,
) -> Result<ServerTls, String>
Expand description

As server_tls, but parses PEM bytes already in memory rather than reading files — the entry point tests use to avoid touching a filesystem.

§Errors

Returns a message if cert_pem/key_pem/client_ca_pem do not parse, or the certificate and key do not match each other.