Support TLS handshake directly without SSLRequest negotiation

Heikki Linnakangas <heikki.linnakangas@iki.fi>

Commit: d39a49c1e459804831302807c724fa6512e90cf0
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: 2024-04-08T01:24:49Z
Releases: 17.0
Support TLS handshake directly without SSLRequest negotiation

By skipping SSLRequest, you can eliminate one round-trip when
establishing a TLS connection. It is also more friendly to generic TLS
proxies that don't understand the PostgreSQL protocol.

This is disabled by default in libpq, because the direct TLS handshake
will fail with old server versions. It can be enabled with the
sslnegotation=direct option. It will still fall back to the negotiated
TLS handshake if the server rejects the direct attempt, either because
it is an older version or the server doesn't support TLS at all, but
the fallback can be disabled with the sslnegotiation=requiredirect
option.

Author: Greg Stark, Heikki Linnakangas
Reviewed-by: Matthias van de Meent, Jacob Champion

Files

Documentation touched