You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the client sends 00 00 00 08 04 d2 16 2f ("SSLRequest" - similar to StartTLS, but more ancient), then set ALPN to pg and send back N to force a plain connection through the tunnel, or S to tunnel TLS within TLS.
If the client sends 00 00 xx xx 00 03 00 00 (message length, v3), then it's a plain postgres connection. The whole first 4 bytes may be the Little-Endian encoded length (supports > 4k query params), but for the purpose of auto-detection we can assume the first two (or even 3) will be 0.
If the client sends
00 00 00 08 04 d2 16 2f
("SSLRequest" - similar to StartTLS, but more ancient), then set ALPN topg
and send backN
to force a plain connection through the tunnel, orS
to tunnel TLS within TLS.If the client sends
00 00 xx xx 00 03 00 00
(message length, v3), then it's a plain postgres connection. The whole first 4 bytes may be the Little-Endian encoded length (supports > 4k query params), but for the purpose of auto-detection we can assume the first two (or even 3) will be0
.See also:
Postgres Magic Bytes
nc -l 54321 | hexyl
PGCONNECT_TIMEOUT=1 psql 'postgres://u:p@localhost:54321/d?sslmode=verify-full'
PGCONNECT_TIMEOUT=1 psql 'postgres://u:p@localhost:54321/d?sslmode=disable'
The text was updated successfully, but these errors were encountered: