Parameter · Connections and Authentication / SSL
ssl_groups
Sets the group(s) to use for Diffie-Hellman key exchange. Multiple groups can be specified using a colon-separated list.
- Default:
X25519:prime256v1 - Type: string
- Applies: Reload
In plain words
The mathematical "groups" (mostly elliptic curves) the server allows for the key exchange at the start of a TLS connection. The default X25519:prime256v1 is supported by practically every client.
For DBAs and operators
PostgreSQL 18 renamed ssl_ecdh_curve to ssl_groups and made it a colon-separated list (before 18 only one curve could be named, and the default was prime256v1 only). It applies to ECDHE in TLS 1.2 and to all TLS 1.3 key exchange. It does not need to match the certificate's key type.
Common values: X25519, prime256v1 (NIST P-256), secp384r1, secp521r1. With OpenSSL 3.5+ hybrid post-quantum groups such as X25519MLKEM768 can be listed too. A client that supports none of the listed groups fails the handshake (server log: could not accept SSL connection: … with an OpenSSL reason such as "no suitable key share"). The old name ssl_ecdh_curve is still accepted as an alias in 18.
How to change it
Change in postgresql.conf or ALTER SYSTEM, then run SELECT pg_reload_conf().