mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-13 17:27:50 +00:00
postgres: tls: accept invalid certificates and mismatched hostnames under "prefer"
This commit is contained in:
parent
9be1512833
commit
a017150890
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user