mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 22:11:36 -05:00
DSQL's own connectors, and libpq's and pgjdbc's sslnegotiation=direct, start TLS at once with no SSLRequest. The endpoint read their ClientHello as a plaintext startup packet and refused it as not TLS. The endpoint now reads a connection's first byte. A TLS handshake record goes straight to the handshake with that byte handed back, and anything else takes the SSLRequest path as before. The byte is TlsProxyServer's TLS_HANDSHAKE, now public, the one the TLS proxy already tells TLS apart by; its peek runs on a Vert.x socket, the endpoint's on a blocking one, so only the constant is shared. As DSQL does (measured, eu-west-1): the endpoint picks the ALPN protocol postgresql whenever a client offers it, after an SSLRequest too, and none otherwise; a direct handshake that does not end with postgresql picked completes and the connection closes without a message. DsqlWireClient opens TLS through one handshake helper, with an ALPN list, after an SSLRequest (tls) or at once (direct), and signs in separately.