How the login works
The agent connects to the gateway’s agent port (the samehost:port as its proxy address, gateway:10255 by default). A standard PostgreSQL client works:
The gateway requires TLS. A plain startup without TLS is refused, so the agent credential never crosses the network in clear text.
Choose the TLS mode
The gateway presents a certificate signed by your instance’s certificate authority, under the fixed namepostgres.gateway.onecli. Download that CA from /v1/gateway/ca on your API. The connect script points PGSSLROOTCERT in agent.env at ca-bundle.pem, which holds the system roots and that CA.
When the database doesn’t answer
If the gateway cannot reach the real database within its login time limit, the agent sees:GATEWAY_ALLOW_PRIVATE_DESTINATIONS on a self-hosted instance. See Hardening.