node-postgres icon indicating copy to clipboard operation
node-postgres copied to clipboard

support PG 17 sslnegotiation=direct

Open wenerme opened this issue 1 year ago • 1 comments

sslnegotiation

This option controls how SSL encryption is negotiated with the server, if SSL is used. In the default postgres mode, the client first asks the server if SSL is supported. In direct mode, the client starts the standard SSL handshake directly after establishing the TCP/IP connection. Traditional PostgreSQL protocol negotiation is the most flexible with different server configurations. If the server is known to support direct SSL connections then the latter requires one fewer round trip reducing connection latency and also allows the use of protocol agnostic SSL network tools. The direct SSL option was introduced in PostgreSQL version 17.

postgres

perform PostgreSQL protocol negotiation. This is the default if the option is not provided.

direct

start SSL handshake directly after establishing the TCP/IP connection. This is only allowed with sslmode=require or higher, because the weaker settings could lead to unintended fallback to plaintext authentication when the server does not support direct SSL handshake.


  • PGJDBC https://github.com/pgjdbc/pgjdbc/pull/3252
  • libpq https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-SSLNEGOTIATION

wenerme avatar Nov 18 '24 04:11 wenerme

Great!

vleite2000 avatar Oct 02 '25 21:10 vleite2000