Re: Feature Proposal: Add ssltermination parameter for SNI-based LoadBalancing

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Lukas Meisegeier <MeisegeierLukas(at)gmx(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Feature Proposal: Add ssltermination parameter for SNI-based LoadBalancing
Date: 2020-12-11 15:44:29
Message-ID: 305c14e9-5342-7f91-46f8-16a4792ecc8a@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/12/2020 16:46, Lukas Meisegeier wrote:
> Hey Heikki,
>
> thanks for providing feedback :)
> The traffic between proxy and psql-server is unencrypted thats why I
> don't need to patch the server.

Ok.

> I tried returning a fixed response on the first plain SSLRequest
> forwarding it to a psql-server with ssl enabled an tried to switch then
> on the ssl connection startup but that didn't work out. I guess its
> because the psql-server won't accept an ssl connection if its not
> requested via SSLRequest.

Your proxy could receive the client's SSLRequest message, and respond
with a single byte 'S'. You don't need to forward that to the real
PostgreSQL server, since the connection to the PostgreSQL server is
unencrypted. Then perform the TLS handshake, and forward all traffic to
the real server only after that.

Client: -> SSLRequest
Proxy: <- 'S'
Client: -> TLS ClientHello
Proxy: [finish TLS handshake]

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Konstantin Knizhnik 2020-12-11 16:05:26 Re: On login trigger: take three
Previous Message Pavel Stehule 2020-12-11 15:40:19 Re: On login trigger: take three