Skip to content

Commit cc93677

Browse files
committed
Fix "unconfigured TLS" panic in db::oneoff_async_connection() fn
1 parent 5673bdd commit cc93677

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/db.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::certs::CRUNCHY;
22
use diesel::{Connection, ConnectionResult, PgConnection, QueryResult};
33
use diesel_async::pooled_connection::deadpool::{Hook, HookError};
44
use diesel_async::pooled_connection::ManagerConfig;
5-
use diesel_async::{AsyncConnection, AsyncPgConnection, RunQueryDsl};
5+
use diesel_async::{AsyncPgConnection, RunQueryDsl};
66
use native_tls::{Certificate, TlsConnector};
77
use postgres_native_tls::MakeTlsConnector;
88
use secrecy::ExposeSecret;
@@ -27,7 +27,7 @@ pub async fn oneoff_async_connection_with_config(
2727
config: &config::DatabasePools,
2828
) -> ConnectionResult<AsyncPgConnection> {
2929
let url = connection_url(config, config.primary.url.expose_secret());
30-
AsyncPgConnection::establish(&url).await
30+
establish_async_connection(&url, config.enforce_tls).await
3131
}
3232

3333
pub async fn oneoff_async_connection() -> anyhow::Result<AsyncPgConnection> {

0 commit comments

Comments
 (0)