diff --git a/test/parallel/test-crypto-x509.js b/test/parallel/test-crypto-x509.js index f75e1d63470bfb..4e32222ceed17f 100644 --- a/test/parallel/test-crypto-x509.js +++ b/test/parallel/test-crypto-x509.js @@ -97,8 +97,6 @@ const der = Buffer.from( assert.strictEqual(x509.infoAccess, infoAccessCheck); assert.strictEqual(x509.validFrom, 'Sep 3 21:40:37 2022 GMT'); assert.strictEqual(x509.validTo, 'Jun 17 21:40:37 2296 GMT'); - assert.deepStrictEqual(x509.validFromDate, new Date('2022-09-03T21:40:37Z')); - assert.deepStrictEqual(x509.validToDate, new Date('2296-06-17T21:40:37Z')); assert.strictEqual( x509.fingerprint, '8B:89:16:C4:99:87:D2:13:1A:64:94:36:38:A5:32:01:F0:95:3B:53'); @@ -118,6 +116,11 @@ const der = Buffer.from( assert.deepStrictEqual(x509.raw, der); + if (!process.features.openssl_is_boringssl) { + assert.deepStrictEqual(x509.validFromDate, new Date('2022-09-03T21:40:37Z')); + assert.deepStrictEqual(x509.validToDate, new Date('2296-06-17T21:40:37Z')); + } + assert(x509.publicKey); assert.strictEqual(x509.publicKey.type, 'public'); @@ -356,13 +359,15 @@ tAt3hIKFD1bJt6c6WtMH2Su3syosWxmdmGk5ihslB00lvLpfj/wed8i3bkcB1doq UcXd/5qu2GhokrKU2cPttU+XAN2Om6a0 -----END CERTIFICATE-----`; - const cert = new X509Certificate(certPem); - assert.throws(() => cert.publicKey, { - message: hasOpenSSL3 ? /decode error/ : /wrong tag/, - name: 'Error' - }); + if (!process.features.openssl_is_boringssl) { + const cert = new X509Certificate(certPem); + assert.throws(() => cert.publicKey, { + message: hasOpenSSL3 ? /decode error/ : /wrong tag/, + name: 'Error' + }); - assert.strictEqual(cert.checkIssued(cert), false); + assert.strictEqual(cert.checkIssued(cert), false); + } } { @@ -401,8 +406,10 @@ UidvpWWipVLZgK+oDks+bKTobcoXGW9oXobiIYqslXPy -----END CERTIFICATE-----`.trim(); const c1 = new X509Certificate(certPemUTCTime); - assert.deepStrictEqual(c1.validFromDate, new Date('1949-12-25T23:59:58Z')); - assert.deepStrictEqual(c1.validToDate, new Date('1950-01-01T23:59:58Z')); + if (!process.features.openssl_is_boringssl) { + assert.deepStrictEqual(c1.validFromDate, new Date('1949-12-25T23:59:58Z')); + assert.deepStrictEqual(c1.validToDate, new Date('1950-01-01T23:59:58Z')); + } // The GeneralizedTime format is used for dates in 2050 or later. const certPemGeneralizedTime = `-----BEGIN CERTIFICATE----- @@ -436,6 +443,8 @@ CWwQO8JZjJqFtqtuzy2n+gLCvqePgG/gmSqHOPm2ZbLW -----END CERTIFICATE-----`.trim(); const c2 = new X509Certificate(certPemGeneralizedTime); - assert.deepStrictEqual(c2.validFromDate, new Date('2049-12-26T00:00:01Z')); - assert.deepStrictEqual(c2.validToDate, new Date('2050-01-02T00:00:01Z')); + if (!process.features.openssl_is_boringssl) { + assert.deepStrictEqual(c2.validFromDate, new Date('2049-12-26T00:00:01Z')); + assert.deepStrictEqual(c2.validToDate, new Date('2050-01-02T00:00:01Z')); + } } diff --git a/test/parallel/test-https-agent-additional-options.js b/test/parallel/test-https-agent-additional-options.js index 543ee176fb6af3..000cb9d3d0c284 100644 --- a/test/parallel/test-https-agent-additional-options.js +++ b/test/parallel/test-https-agent-additional-options.js @@ -13,23 +13,31 @@ const options = { cert: fixtures.readKey('agent1-cert.pem'), ca: fixtures.readKey('ca1-cert.pem'), minVersion: 'TLSv1.1', - ciphers: 'ALL@SECLEVEL=0' }; +if (!process.features.openssl_is_boringssl) { + options.ciphers = 'ALL@SECLEVEL=0'; +} + const server = https.Server(options, (req, res) => { res.writeHead(200); res.end('hello world\n'); }); function getBaseOptions(port) { - return { + const baseOptions = { path: '/', port: port, ca: options.ca, rejectUnauthorized: true, servername: 'agent1', - ciphers: 'ALL@SECLEVEL=0' }; + + if (!process.features.openssl_is_boringssl) { + baseOptions.ciphers = 'ALL@SECLEVEL=0'; + } + + return baseOptions; } const updatedValues = new Map([ diff --git a/test/parallel/test-https-agent-session-eviction.js b/test/parallel/test-https-agent-session-eviction.js index 6f88e81e9ff29d..a3fd362b5c5ae8 100644 --- a/test/parallel/test-https-agent-session-eviction.js +++ b/test/parallel/test-https-agent-session-eviction.js @@ -17,9 +17,12 @@ const options = { key: readKey('agent1-key.pem'), cert: readKey('agent1-cert.pem'), secureOptions: SSL_OP_NO_TICKET, - ciphers: 'RSA@SECLEVEL=0' }; +if (!process.features.openssl_is_boringssl) { + options.ciphers = 'RSA@SECLEVEL=0'; +} + // Create TLS1.2 server https.createServer(options, function(req, res) { res.writeHead(200, { 'Connection': 'close' }); diff --git a/test/parallel/test-webcrypto-derivebits.js b/test/parallel/test-webcrypto-derivebits.js index eb09bc24f0cb82..0db467b852283a 100644 --- a/test/parallel/test-webcrypto-derivebits.js +++ b/test/parallel/test-webcrypto-derivebits.js @@ -123,6 +123,8 @@ const { subtle } = globalThis.crypto; assert.deepStrictEqual(secret1, secret2); } - test('X25519').then(common.mustCall()); - test('X448').then(common.mustCall()); + if (!process.features.openssl_is_boringssl) { + test('X25519').then(common.mustCall()); + test('X448').then(common.mustCall()); + } } diff --git a/test/parallel/test-webcrypto-derivekey.js b/test/parallel/test-webcrypto-derivekey.js index 558d37d90d5796..90f76839474e16 100644 --- a/test/parallel/test-webcrypto-derivekey.js +++ b/test/parallel/test-webcrypto-derivekey.js @@ -206,6 +206,8 @@ const { KeyObject } = require('crypto'); assert.deepStrictEqual(raw1, raw2); } - test('X25519').then(common.mustCall()); - test('X448').then(common.mustCall()); + if (!process.features.openssl_is_boringssl) { + test('X25519').then(common.mustCall()); + test('X448').then(common.mustCall()); + } } diff --git a/test/parallel/test-webcrypto-sign-verify.js b/test/parallel/test-webcrypto-sign-verify.js index de736102bdcb71..1b2b40152f88d2 100644 --- a/test/parallel/test-webcrypto-sign-verify.js +++ b/test/parallel/test-webcrypto-sign-verify.js @@ -121,8 +121,9 @@ const { subtle } = globalThis.crypto; name: 'Ed25519', }, publicKey, signature, ec.encode(data))); } - - test('hello world').then(common.mustCall()); + if (!process.features.openssl_is_boringssl) { + test('hello world').then(common.mustCall()); + } } // Test Sign/Verify Ed448 @@ -142,5 +143,7 @@ const { subtle } = globalThis.crypto; }, publicKey, signature, ec.encode(data))); } - test('hello world').then(common.mustCall()); + if (!process.features.openssl_is_boringssl) { + test('hello world').then(common.mustCall()); + } }