mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-26 08:01:38 +00:00
fix: postgres ssl mode (#2861)
This commit is contained in:
@@ -67,7 +67,12 @@ pub async fn do_postgresql(
|
||||
} else {
|
||||
return Err(Error::BadRequest("Missing database argument".to_string()));
|
||||
};
|
||||
let sslmode = database.sslmode.unwrap_or("prefer".to_string());
|
||||
let sslmode = match database.sslmode.as_deref() {
|
||||
Some("allow") => "prefer".to_string(),
|
||||
Some("verify-ca") | Some("verify-full") => "require".to_string(),
|
||||
Some(s) => s.to_string(),
|
||||
None => "prefer".to_string(),
|
||||
};
|
||||
let database_string = format!(
|
||||
"postgres://{user}:{password}@{host}:{port}/{dbname}?sslmode={sslmode}",
|
||||
user = encode(&database.user.unwrap_or("postgres".to_string())),
|
||||
|
||||
Reference in New Issue
Block a user