Skip to main content

validate_restored_tcp_config

Function validate_restored_tcp_config 

Source
pub(crate) fn validate_restored_tcp_config(cfg: &ServerConfig) -> Result<()>
Expand description

Validate restored TCP transport material before building TlsTcpConnector.

ServerConfig::tls_config() and TlsTcpConnector::new() contain invariant checks that are fine for generated configs but too panic-prone for uploaded restore data. This preflights the same key/certificate material and returns a normal restore error before any files are installed.

Keep this in sync with the panic points in ServerConfig::tls_config(): missing private.tls_key, malformed TLS private-key hex, malformed TLS certificate hex, and malformed TLS private-key DER.