Cannot Connect / TLS
StableWhat to check if an application or psql cannot establish a connection to the database through Gateway.
Updated: March 5, 2026
If the client cannot connect to PostgreSQL because of TLS or a network error, check several things in order.
1. Make sure you are using the correct entry point
You must connect to the Gateway host from Console or from the issued DSN, not to an internal worker.
For the main managed environment, this is usually:
pg.spg99.ru:5432
If you have a separate test environment, use the host from that DSN.
2. Check the DSN
The connection string must include:
- the correct host;
- port
5432; pg_user/pg_password;- at least
sslmode=require.
3. Do not confuse secrets
- API key is used only for Console and the Control Plane API;
- the DSN must contain only tenant PostgreSQL credentials.
4. Account for the stopped state
If the database is in stopped, that is not an outage. The first connection may initiate auto-start and take a little longer. Therefore, a too-small connect_timeout can create the false impression that “TLS is not working.”
5. If you use strict certificate validation
For sslmode=verify-full, make sure that:
- the client has access to the correct CA chain;
- the hostname in the certificate matches the Gateway domain.
6. Check the corporate network
TLS inspection, MITM proxies, and strict firewall policies can break the connection. In that case, verify reachability of the gateway domain and that the TLS session is not being intercepted.
What to include in a support request
- the exact driver error text;
- the DSN without the password;
- tenant and database name;
- time of failure;
- the database state from Console or the API.
