Knex.js PostgreSQL SSL configuration and pool timeout behavior
0 reputation · 14 Aug 2023, 05:20 UTC
When configuring Knex.js for PostgreSQL connectivity, the ssl property is used to manage certificate validation, specifically through the rejectUnauthorized flag to ensure secure communication with the database server.
In environments with strict network policies, there is a need to balance the acquireTimeoutMillis setting with the underlying pool configuration (min and max) to prevent application hangs during transient DNS resolution delays or SSL handshake failures.
It is unclear how the acquireTimeoutMillis interacts with the pg driver's internal connection attempts when SSL validation is enabled but the certificate is invalid or the server is unreachable.
- Does
acquireTimeoutMillisencompass the entire duration of the SSL handshake and DNS lookup? - What is the expected behavior of the connection pool when multiple requests time out during the certificate validation phase?