File tree Expand file tree Collapse file tree
apps/sim/app/api/tools/postgresql Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,12 +9,17 @@ export async function createPostgresConnection(config: PostgresConnectionConfig)
99 }
1010
1111 const resolvedHost = hostValidation . resolvedIP ?? config . host
12+ const pinIP = config . ssl !== 'preferred'
1213
13- const sslConfig : boolean | { rejectUnauthorized : boolean ; servername ?: string } =
14- config . ssl === 'disabled' ? false : { rejectUnauthorized : false , servername : config . host }
14+ const sslConfig : boolean | 'prefer' | { rejectUnauthorized : boolean ; servername ?: string } =
15+ config . ssl === 'disabled'
16+ ? false
17+ : config . ssl === 'preferred'
18+ ? 'prefer'
19+ : { rejectUnauthorized : false , servername : config . host }
1520
1621 const sql = postgres ( {
17- host : resolvedHost ,
22+ host : pinIP ? resolvedHost : config . host ,
1823 port : config . port ,
1924 database : config . database ,
2025 username : config . username ,
You can’t perform that action at this time.
0 commit comments