oa_gateway::tls

Function load

Source
pub(crate) fn load(config: &Config) -> Result<HostTls, String>
Expand description

Reads the certificates and keys named in config, if any.

A disabled adapter’s TLS settings are not read, matching how crate::adapters::start only resolves addresses for enabled adapters.

§Errors

Returns an error if owp.tls_cert/owp.tls_key is set without its pair, if owp.tls_client_ca is set without both of those, if stomp.tls_client_cert/stomp.tls_client_key is set without stomp.tls = true, if a cert/key/CA file cannot be read, if a certificate does not parse or does not match its key, or if stomp.tls_server_name (or the host part of stomp.broker, when that is empty) is not a usable DNS name or IP address.