postgres: tls: accept invalid certificates and mismatched hostnames under "prefer"

This commit is contained in:
Ryan Leckey 2020-03-20 09:47:18 -07:00
parent 9be1512833
commit a017150890

View File

@ -12,7 +12,7 @@ pub(crate) async fn request_if_needed(stream: &mut PgStream, url: &Url) -> crate
#[cfg(feature = "tls")]
Some("prefer") | None => {
// We default to [prefer] if TLS is compiled in
if !try_upgrade(stream, url, false, false).await? {
if !try_upgrade(stream, url, true, true).await? {
// TLS upgrade failed; fall back to a normal connection
}
}