Skip to content

Commit c61ba86

Browse files
authored
test: account for OpenSSL 4.x changes
Skip the client certificate and private key engine addon tests on OpenSSL 4, which no longer supports engines. Account for OpenSSL 4.1 no longer checking the subject CN by default in X509Certificate.checkHost(). Keep explicit subject matching and TLS CN fallback expectations unchanged. Signed-off-by: Filip Skokan <panva.ip@gmail.com> Assisted-by: Codex PR-URL: #66775 Reviewed-By: Richard Lau <richard.lau@ibm.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent c526694 commit c61ba86

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

‎test/addons/openssl-client-cert-engine/test.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ const fixture = require('../../common/fixtures');
55
if (!common.hasCrypto)
66
common.skip('missing crypto');
77

8+
const { hasOpenSSL } = require('../../common/crypto');
9+
10+
if (hasOpenSSL(4))
11+
common.skip('OpenSSL 4 does not support engines');
12+
813
const fs = require('fs');
914
const path = require('path');
1015

‎test/addons/openssl-key-engine/test.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ const fixture = require('../../common/fixtures');
55
if (!common.hasCrypto)
66
common.skip('missing crypto');
77

8+
const { hasOpenSSL } = require('../../common/crypto');
9+
10+
if (hasOpenSSL(4))
11+
common.skip('OpenSSL 4 does not support engines');
12+
813
const fs = require('fs');
914
const path = require('path');
1015

‎test/parallel/test-x509-escaping.js‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ const { hasOpenSSL, isBoringSSL } = require('../common/crypto');
472472
})).unref();
473473
}
474474

475-
// The subject MUST NOT be ignored if no dNSName subject alternative name
475+
// TLS MUST NOT ignore the subject if no dNSName subject alternative name
476476
// exists, even if other subject alternative names exist.
477477
{
478478
const key = fixtures.readKey('irrelevant_san_correct_subject-key.pem');
@@ -485,13 +485,12 @@ const { hasOpenSSL, isBoringSSL } = require('../common/crypto');
485485
assert.strictEqual(certX509.subjectAltName, 'IP Address:1.2.3.4');
486486

487487
// The newer X509Certificate API allows customizing this behavior:
488-
const cnFallback = isBoringSSL ? undefined :
489-
servername;
488+
const cnFallback = isBoringSSL || hasOpenSSL(4, 1) ? undefined : servername;
490489
assert.strictEqual(certX509.checkHost(servername), cnFallback);
491490
assert.strictEqual(certX509.checkHost(servername, { subject: 'default' }),
492491
cnFallback);
493492
assert.strictEqual(certX509.checkHost(servername, { subject: 'always' }),
494-
cnFallback);
493+
isBoringSSL ? undefined : servername);
495494
assert.strictEqual(certX509.checkHost(servername, { subject: 'never' }),
496495
undefined);
497496

0 commit comments

Comments
 (0)