diff --git a/Cargo.toml b/Cargo.toml
index fbba47c9116c3432ff05feba0faae36f88685399..f8178b336185f81bf21d82d3495ece7a140dbf34 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -99,7 +99,7 @@ activitypub_federation = { version = "0.5.0-beta.5", default-features = false, f
 ] }
 diesel = "2.1.4"
 diesel_migrations = "2.1.0"
-diesel-async = "0.3.2"
+diesel-async = "0.4.1"
 serde = { version = "1.0.193", features = ["derive"] }
 serde_with = "3.4.0"
 actix-web = { version = "4.4.0", default-features = false, features = [
diff --git a/crates/db_schema/src/utils.rs b/crates/db_schema/src/utils.rs
index 594c9362918b4c9ad1a067bacee386c95048b0d8..9ac2d4c881b6117a49a16995a1e1a2990f91cba5 100644
--- a/crates/db_schema/src/utils.rs
+++ b/crates/db_schema/src/utils.rs
@@ -24,6 +24,7 @@ use diesel_async::{
   pooled_connection::{
     deadpool::{Object as PooledConnection, Pool},
     AsyncDieselConnectionManager,
+    ManagerConfig,
   },
 };
 use diesel_migrations::EmbeddedMigrations;
@@ -291,7 +292,9 @@ pub async fn build_db_pool() -> Result<ActualDbPool, LemmyError> {
   let manager = if tls_enabled {
     // diesel-async does not support any TLS connections out of the box, so we need to manually
     // provide a setup function which handles creating the connection
-    AsyncDieselConnectionManager::<AsyncPgConnection>::new_with_setup(&db_url, establish_connection)
+    let mut config = ManagerConfig::default();
+    config.custom_setup = Box::new(establish_connection);
+    AsyncDieselConnectionManager::<AsyncPgConnection>::new_with_config(&db_url, config)
   } else {
     AsyncDieselConnectionManager::<AsyncPgConnection>::new(&db_url)
   };