cmd/pgproxy: fix client TLS handshake timeout

There is a 30-second timeout set on client TLS connections but the handshake was
called on the wrong connection and so the timeout was never used in practice.

Signed-off-by: Francois Marier <francois@fmarier.org>
This commit is contained in:
Francois Marier 2026-05-09 11:01:45 -07:00 committed by Brad Fitzpatrick
parent 2f45a6a9d8
commit ead5ce65a3

View File

@ -291,7 +291,7 @@ func (p *proxy) serve(sessionID int64, c net.Conn) error {
Certificates: p.downstreamCert,
MinVersion: tls.VersionTLS12,
})
if err = uptc.HandshakeContext(ctx); err != nil {
if err = s.HandshakeContext(ctx); err != nil {
p.errors.Add("client-tls", 1)
return fmt.Errorf("client TLS handshake: %v", err)
}