sfackler / rust-postgres

Native PostgreSQL driver for the Rust programming language
Apache License 2.0
3.52k stars 446 forks source link

feat: sslnegotiation and direct ssl for postgres 17 #1151

Open sunng87 opened 4 months ago

sunng87 commented 4 months ago

This patch adds Direct SSL support which is a new feature coming in PostgreSQL 17. With this option, we issue TLS handshake directly without SslRequest. This will save a roundtrip on connection opening.

I just follow how libpq is designed, to offer an option sslnegotiation to control this behaviour (because it won't work on Postgres 16 or earlier).

sfackler commented 4 months ago

Seems reasonable to me, but I think it might make sense to wait on merging until 17 releases.

sunng87 commented 4 months ago

No problem. I'm using this to test my own postgresql wire protocol implementation

And the clippy issue seems not related to this patch, I can create another one to fix that. Edit: Just saw it's been fixed on default branch

sunng87 commented 2 months ago

@sfackler Postgres 17 just released