Skip to content

Commit daa02c6

Browse files
Add X25519 to the default set of curves
Since many clients default to the X25519 curve in the TLS handshake, the fact that the server by defualt doesn't support it cause an extra roundtrip for each TLS connection. By adding multiple curves, which is supported since 3d1ef3a, we can reduce the risk of extra roundtrips. Author: Daniel Gustafsson <daniel@yesql.se> Co-authored-by: Jacob Champion <jacob.champion@enterprisedb.com> Reported-by: Andres Freund <andres@anarazel.de> Reviewed-by: Jacob Champion <jacob.champion@enterprisedb.com> Discussion: https://postgr.es/m/20240616234612.6cslu7nqexquvwj7@awork3.anarazel.de
1 parent 4fd02bf commit daa02c6

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

doc/src/sgml/config.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,7 @@ include_dir 'conf.d'
15201520
It does not need to be the same curve used by the server's Elliptic
15211521
Curve key. This parameter can only be set in the
15221522
<filename>postgresql.conf</filename> file or on the server command line.
1523-
The default is <literal>prime256v1</literal>.
1523+
The default is <literal>X25519:prime256v1</literal>.
15241524
</para>
15251525

15261526
<para>

src/backend/utils/misc/guc_tables.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4768,7 +4768,7 @@ struct config_string ConfigureNamesString[] =
47684768
},
47694769
&SSLECDHCurve,
47704770
#ifdef USE_SSL
4771-
"prime256v1",
4771+
"X25519:prime256v1",
47724772
#else
47734773
"none",
47744774
#endif

src/backend/utils/misc/postgresql.conf.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
#ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed TLSv1.2 ciphers
115115
#ssl_tls13_ciphers = '' # allowed TLSv1.3 cipher suites, blank for default
116116
#ssl_prefer_server_ciphers = on
117-
#ssl_groups = 'prime256v1'
117+
#ssl_groups = 'X25519:prime256v1'
118118
#ssl_min_protocol_version = 'TLSv1.2'
119119
#ssl_max_protocol_version = ''
120120
#ssl_dh_params_file = ''

src/test/ssl/t/SSL/Server.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ sub switch_server_cert
301301
$node->append_conf('sslconfig.conf', "ssl=on");
302302
$node->append_conf('sslconfig.conf', $backend->set_server_cert(\%params));
303303
# use lists of ECDH curves and cipher suites for syntax testing
304-
$node->append_conf('sslconfig.conf', 'ssl_groups=prime256v1:secp521r1');
304+
$node->append_conf('sslconfig.conf', 'ssl_groups=X25519:prime256v1:secp521r1');
305305
$node->append_conf('sslconfig.conf',
306306
'ssl_tls13_ciphers=TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256');
307307

0 commit comments

Comments
 (0)