[PATCH] test: update parallel/test-tls-dhe for OpenSSL 3.5
authorRichard Lau <rlau@redhat.com>
Mon, 17 Mar 2025 03:42:55 +0000 (03:42 +0000)
committerJérémy Lal <kapouer@melix.org>
Thu, 1 May 2025 09:09:56 +0000 (11:09 +0200)
The output of the `s_client` command invoked by the test has changed
in the OpenSSL 3.5.0 version of `s_client`. Update the test so that
it works with both the old and new output -- the `s_client` binary
being run may not be at the exact same version of OpenSSL as used
by Node.js so the updated test allows either output.

PR-URL: https://github.com/nodejs/node/pull/57477
Refs: https://github.com/openssl/openssl/pull/26734
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Gbp-Pq: Topic build
Gbp-Pq: Name test-update-parallel-test-tls-dhe-for-OpenSSL-3.5.patch

test/parallel/test-tls-dhe.js

index 21739ce42428ebe8f8f9d86cdfcfe14211afffcf..ce302f623a5b8c9e8dd8c2d4153eb9f9418d97aa 100644 (file)
@@ -72,7 +72,10 @@ function test(dhparam, keylen, expectedCipher) {
 
     execFile(common.opensslCli, args, common.mustSucceed((stdout) => {
       assert(keylen === null ||
-             stdout.includes(`Server Temp Key: DH, ${keylen} bits`));
+             // s_client < OpenSSL 3.5
+             stdout.includes(`Server Temp Key: DH, ${keylen} bits`) ||
+             // s_client >= OpenSSL 3.5
+             stdout.includes(`Peer Temp Key: DH, ${keylen} bits`));
       assert(stdout.includes(`Cipher    : ${expectedCipher}`));
       server.close();
     }));