Connect to a database

Connect over TLS with the connection strings on the Connection tab, and verify the server with the platform's CA bundle.

Last updated 18 November 2026View as Markdown

Replace orders_admin and orders with your master user and database, and ewdb-0123456789ab with your database's id.

Prerequisites

Get the connection strings

  1. Open the database, then choose Connection.
  2. Copy Application (pooled), Direct, or, on a cluster, Read replicas (pooled).

Substitute the password:

postgresql://orders_admin:<password>@192.0.2.7:6432/orders?sslmode=require   # applications
postgresql://orders_admin:<password>@192.0.2.7:5432/orders?sslmode=require   # direct
postgresql://orders_admin:<password>@192.0.2.7:6433/orders?sslmode=require   # read replicas, cluster only

The console's strings use the host to connect to: the endpoint's DNS name once the database's certificate carries it, otherwise its address; for a private database, its address or name inside the network.

sslmode=require encrypts the connection. To also verify that you are talking to your database, use verify-full.

Connect with verify-full

  1. On the database's Connection tab, choose Download CA bundle.
  2. Copy Verify the server (verify-full) and point sslrootcert at the downloaded file.

The CA bundle is the same file for every database in the installation. The certificate names the endpoint address and the endpoint's DNS names (<id>.db.apps.<root-domain> for the public endpoint, <id>.private.db.apps.<root-domain> for the private one); verify-full succeeds against any of them. Without sslrootcert, verify-full and verify-ca fail.

From Node.js, connect by name. node-postgres cannot verify a certificate for an IP host: it checks it against localhost and fails, and it treats sslmode=require as verify-full. A bound app is given the name for this reason. A database created before the names existed is given its address until its certificate is next renewed.

From an app deployed on Deutsche Cloud, no download is needed: every container has the CA at /etc/ews/ca/platform-ca.pem, and Node trusts it already (see Bind a managed database in the Apps User Guide). Use that path as sslrootcert.

TLS reference

Where TLS is served every port, direct and pooled
Certificate subject the database id
Certificate names the endpoint address, as an IP, and the endpoint DNS names
Issuer Deutsche Cloud Managed Databases CA (an older installation's CA keeps the name it was made with), one per installation, valid ten years
Certificate validity two years from creation
Renewal automatic, from the machine, once the certificate is inside its last 30 days; connections are not interrupted
Expiry warning written to Activity from 30 days out, once a day; as an error inside 7 days
CA bundle GET /rds/api/ca-bundle → dcloud-rds-ca-bundle.pem
Shown on the database page the certificate's expiry and serial

sslmode values, as libpq treats them against this database:

sslmode Encrypted Verifies the server Needs sslrootcert
disable no no no
allow, prefer yes no no
require yes no no
verify-ca yes issuer only yes
verify-full yes issuer and address yes

With Require TLS on (the default for new databases), a client that does not ask for TLS is refused: no pg_hba.conf entry … no encryption on 5432, SSL required on 6432. With it off, it gets a plaintext connection. See Require TLS.

Result

SELECT version(); answers. With verify-full, the client has checked that the certificate was issued by the platform's CA for the address or name you connected to.

Did this page help you?