Skip to content

Commit a246642

Browse files
committed
fixup! crypto: add guards and adjust tests for BoringSSL
1 parent 7da6011 commit a246642

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
'use strict';
2+
const common = require('../common');
3+
if (!common.hasCrypto)
4+
common.skip('missing crypto');
5+
6+
if (!process.features.openssl_is_boringssl)
7+
common.skip('only applies to BoringSSL builds');
8+
9+
const assert = require('assert');
10+
const tls = require('tls');
11+
12+
// BoringSSL does not provide SSL_CTX_set_dh_auto, so requesting automatic
13+
// DH parameter selection via `dhparam: 'auto'` must throw.
14+
assert.throws(() => {
15+
tls.createSecureContext({ dhparam: 'auto' });
16+
}, {
17+
code: 'ERR_CRYPTO_UNSUPPORTED_OPERATION',
18+
message: 'Automatic DH parameter selection is not supported',
19+
});

0 commit comments

Comments
 (0)