Set ALPN for direct SSL connect - #1332
Conversation
|
In https://github.com/lib/pq/actions/runs/29415703853/job/87371180560, all tests for Postgres before 17.0 were failing. This happened because we are testing a feature that has been introduced with 17.0. I searched the code base for established practices and it seems there are skip helpers but none of them based on versions. I have pushed 8b7f21d to introduce a smaller helper to ensure that these tests only run on Postgres 17+. Please let me know if
|
|
Thanks; seems good. The tests can probably be a bit simpler? I think just establishing an actual connection with |
|
Thanks for your feedback. I have applied all your suggestions now in d763c69. |
When sslnegotiation=direct is set, clients receive EOF. This happens because PostgreSQL expects the ALPN "postgresql" to be set, but the client's TLS configuration doesn't specify it. This adds that, identical to what libpq does. Fixes lib#1331 Co-authored-by: Martin Tournoij <martin@arp242.net>
|
Cheers, thanks! |
When
sslnegotiation=directis set, clients receiveEOF. This happens because Postgres expects the ALPNpostgresqlto be set but the client's TLS configuration doesn't specify it. With this commit we explicitly set the expected ALPN, allowing connections to succeed.Closes #1331