From a0171508902ee6543d8e1dacbe91e4c3d74f2214 Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Fri, 20 Mar 2020 09:47:18 -0700 Subject: [PATCH] postgres: tls: accept invalid certificates and mismatched hostnames under "prefer" --- sqlx-core/src/postgres/tls.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlx-core/src/postgres/tls.rs b/sqlx-core/src/postgres/tls.rs index b8061eb2f..fd2f8b27a 100644 --- a/sqlx-core/src/postgres/tls.rs +++ b/sqlx-core/src/postgres/tls.rs @@ -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 } }