fn classify_connect_error(
source: Error,
profile: &Profile,
mode: SslMode,
) -> ConnectionErrorExpand description
Classify a tokio_postgres::Error surfaced from Config::connect(...)
into the most specific ConnectionError variant.
Rules:
- OpenSSL error found in the source chain +
modeisverify-*→ConnectionError::TlsVerification(withhostname_suffixif the OpenSSL message names a hostname / IP mismatch). modeisrequire/verify-*and the error message indicates the server refused TLS →ConnectionError::TlsRequiredNotSupported.- Otherwise →
ConnectionError::Connect.