From 3d1ef3a15c3eb68dae44b94e89d04c422b26fc16 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Thu, 24 Oct 2024 15:20:28 +0200 Subject: Support configuring multiple ECDH curves The ssl_ecdh_curve GUC only accepts a single value, but the TLS handshake can list multiple curves in the groups extension (the extension has been renamed to contain more than elliptic curves). This changes the GUC to accept a colon-separated list of curves. This commit also renames the GUC to ssl_groups to match the new nomenclature for the TLS extension. Original patch by Erica Zhang with additional hacking by me. Author: Erica Zhang Author: Daniel Gustafsson Reviewed-by: Jacob Champion Reviewed-by: Andres Freund Reviewed-by: Peter Eisentraut Reviewed-by: Jelte Fennema-Nio Discussion: https://postgr.es/m/tencent_063F89FA72CCF2E48A0DF5338841988E9809@qq.com --- doc/src/sgml/config.sgml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 934ef5e4691..f8d862a6ce4 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -1452,20 +1452,20 @@ include_dir 'conf.d' - - ssl_ecdh_curve (string) + + ssl_groups (string) - ssl_ecdh_curve configuration parameter + ssl_groups configuration parameter Specifies the name of the curve to use in ECDH key exchange. It needs to be supported by all clients that connect. + Multiple curves can be specified by using a colon-separated list. It does not need to be the same curve used by the server's Elliptic - Curve key. - This parameter can only be set in the postgresql.conf - file or on the server command line. + Curve key. This parameter can only be set in the + postgresql.conf file or on the server command line. The default is prime256v1. @@ -1475,9 +1475,16 @@ include_dir 'conf.d' prime256v1 (NIST P-256), secp384r1 (NIST P-384), secp521r1 (NIST P-521). - The full list of available curves can be shown with the command - openssl ecparam -list_curves. Not all of them - are usable in TLS though. + An incomplete list of available groups can be shown with the command + openssl ecparam -list_curves. Not all of them are + usable with TLS though, and many supported group + names and aliases are omitted. + + + + In PostgreSQL versions before 18.0 this + setting was named ssl_ecdh_curve and only accepted + a single value. -- cgit v1.2.3