TeamSQL / desktop-app

This repository is currently being used for hosting the official issue & bug tracker of TeamSQL Desktop App.
102 stars 6 forks source link

Cannot make TLS connections to pgbouncer+stunnel #335

Open warenix opened 6 years ago

warenix commented 6 years ago

When I create a new postgres db connection which is acutally a pgbouncer+stunnel endpoint, I see an error message:

Database server connection failed! Connection timeout

I expect TeamSQL will connect to the endpoint with SSL.

Here's the setup

image

Log from pgbouncer

stunnel: LOG7[main]: FD=4 events=0x2001 revents=0x0
stunnel: LOG7[main]: FD=6 events=0x2001 revents=0x1
stunnel: LOG7[main]: Service [pg-server] accepted (FD=3) from 172.17.0.1:45448
stunnel: LOG7[48]: Service [pg-server] started
stunnel: LOG7[48]: Option TCP_NODELAY set on local socket
stunnel: LOG5[48]: Service [pg-server] accepted connection from 172.17.0.1:45448
stunnel: LOG3[48]: PostgreSQL client did not request TLS, rejecting
stunnel: LOG5[48]: Connection reset: 0 byte(s) sent to TLS, 0 byte(s) sent to socket
stunnel: LOG7[48]: Local descriptor (FD=3) closed
stunnel: LOG7[48]: Service [pg-server] finished (0 left)

Env

Version: v4.0.270 OS: Ubuntu 18.04

ghost commented 6 years ago

Hi @warenix, thanks for reaching out to us. Let me check with the team and get back to you with more detailed information.

murtezao commented 6 years ago

Hi @warenix ,

Is this error occur on TeamSQL V4.0.307?

-- Erol from TeamSQL

warenix commented 6 years ago

Feel like the SSL is made as I can see table names being listed next to the connection.

But I doubt the connection is working or not as I couldn't query anything while TeamSQL says connection is established.

See this screenshot: bigcache000 is one of the database names

image

warenix commented 6 years ago

More info about my setup

OS: ubuntu 18.04

apt-cache policy stunnel4
stunnel4:
  Installed: 3:5.44-1ubuntu3
  Candidate: 3:5.44-1ubuntu3
  Version table:
 *** 3:5.44-1ubuntu3 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status

tunnel-srv.conf

debug = info
socket = l:TCP_NODELAY=1

debug = 7
foreground = yes

cert = /home/ubuntu/pgbouncer/stunnel/stunnel.pem
key = /home/ubuntu/pgbouncer/stunnel/stunnel.key
pid = /home/ubuntu/pgbouncer/stunnel/stunnel.pid

[pg-server]
client=no
accept = 0.0.0.0:5544
connect = 127.0.0.1:6655
protocol = pgsql
murtezao commented 6 years ago

Hi @warenix ,

I'll remind your question to the product team, immediately. They will reach you with a solution very soon.