pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
psql connect over ssl load balancer
3+ messages / 2 participants
[nested] [flat]

* psql connect over ssl load balancer
@ 2022-05-23 17:28  dzagashev@gmail.com <dzagashev@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: dzagashev@gmail.com @ 2022-05-23 17:28 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Hi.

I want to secure connections to postgress server usings SSL.
My server is deployed on google cloud behind SSL load balancer, which 
terminates SSL connections (using SSL certificates, issued by google) 
and forwards decrypted traffic to the posgres server.

I can connect without problems from nodejs using TLS socket.

But standard psql client don't working:

$ PGSSLMODE=require psql -h proxy.softvisio.net

psql: error: connection to server at "proxy.softvisio.net" 
(34.149.158.159), port 5432 failed: server closed the connection 
unexpectedly
         This probably means the server terminated abnormally
         before or while processing the request.


Seems, that psql will not work withour private keys? But I am not sure.

Could somebody help me to understand, how I can use it?





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: psql connect over ssl load balancer
@ 2022-05-23 17:32  Tom Lane <tgl@sss.pgh.pa.us>
  parent: dzagashev@gmail.com <dzagashev@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2022-05-23 17:32 UTC (permalink / raw)
  To: dzagashev@gmail.com <dzagashev@gmail.com>; +Cc: pgsql-general@lists.postgresql.org

"dzagashev@gmail.com" <dzagashev@gmail.com> writes:
> I want to secure connections to postgress server usings SSL.
> My server is deployed on google cloud behind SSL load balancer, which 
> terminates SSL connections (using SSL certificates, issued by google) 
> and forwards decrypted traffic to the posgres server.
> But standard psql client don't working:
> $ PGSSLMODE=require psql -h proxy.softvisio.net

That isn't going to work, because PG wraps the SSL handshake inside
its own protocol.  You could set up an SSL tunnel and let psql think
it's making a non-encrypted connection.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: psql connect over ssl load balancer
@ 2022-05-23 17:40  dzagashev@gmail.com <dzagashev@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: dzagashev@gmail.com @ 2022-05-23 17:40 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-general@lists.postgresql.org

Ah, thanks.
This will make thing more complex.

On 23.05.2022 20:32, Tom Lane wrote:
> "dzagashev@gmail.com" <dzagashev@gmail.com> writes:
>> I want to secure connections to postgress server usings SSL.
>> My server is deployed on google cloud behind SSL load balancer, which
>> terminates SSL connections (using SSL certificates, issued by google)
>> and forwards decrypted traffic to the posgres server.
>> But standard psql client don't working:
>> $ PGSSLMODE=require psql -h proxy.softvisio.net
> 
> That isn't going to work, because PG wraps the SSL handshake inside
> its own protocol.  You could set up an SSL tunnel and let psql think
> it's making a non-encrypted connection.
> 
> 			regards, tom lane





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2022-05-23 17:40 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-05-23 17:28 psql connect over ssl load balancer dzagashev@gmail.com <dzagashev@gmail.com>
2022-05-23 17:32 ` Tom Lane <tgl@sss.pgh.pa.us>
2022-05-23 17:40   ` dzagashev@gmail.com <dzagashev@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox