GeezerVison is showing github.com — test: adapt tests for OpenSSL 3.1 · nodejs/node@9875885
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: test/common/index.js +5-1Lines changed: 5 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -57,7 +57,10 @@ const hasCrypto = Boolean(process.versions.openssl) && | 57 | 57 | !process.env.NODE_SKIP_CRYPTO; | 58 | 58 |
| 59 | 59 | const hasOpenSSL3 = hasCrypto && | 60 | | - require('crypto').constants.OPENSSL_VERSION_NUMBER >= 805306368; | | 60 | + require('crypto').constants.OPENSSL_VERSION_NUMBER >= 0x30000000; | | 61 | + | | 62 | +const hasOpenSSL31 = hasCrypto && | | 63 | + require('crypto').constants.OPENSSL_VERSION_NUMBER >= 0x30100000; | 61 | 64 |
| 62 | 65 | const hasQuic = hasCrypto && !!process.config.variables.openssl_quic; | 63 | 66 |
| @@ -911,6 +914,7 @@ const common = { | 911 | 914 | hasIntl, | 912 | 915 | hasCrypto, | 913 | 916 | hasOpenSSL3, | | 917 | + hasOpenSSL31, | 914 | 918 | hasQuic, | 915 | 919 | hasMultiLocalhost, | 916 | 920 | invalidArgTypeHelper, | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-https-agent-session-eviction.js +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -56,6 +56,7 @@ function faultyServer(port) { | 56 | 56 | function second(server, session) { | 57 | 57 | const req = https.request({ | 58 | 58 | port: server.address().port, | | 59 | + ciphers: (common.hasOpenSSL31 ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT'), | 59 | 60 | rejectUnauthorized: false | 60 | 61 | }, function(res) { | 61 | 62 | res.resume(); | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-tls-alert.js +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -42,6 +42,7 @@ const server = tls.Server({ | 42 | 42 | cert: loadPEM('agent2-cert') | 43 | 43 | }, null).listen(0, common.mustCall(() => { | 44 | 44 | const args = ['s_client', '-quiet', '-tls1_1', | | 45 | + '-cipher', (common.hasOpenSSL31 ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT'), | 45 | 46 | '-connect', `127.0.0.1:${server.address().port}`]; | 46 | 47 |
| 47 | 48 | execFile(common.opensslCli, args, common.mustCall((err, _, stderr) => { | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-tls-getprotocol.js +13-3Lines changed: 13 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -11,9 +11,18 @@ const tls = require('tls'); | 11 | 11 | const fixtures = require('../common/fixtures'); | 12 | 12 |
| 13 | 13 | const clientConfigs = [ | 14 | | - { secureProtocol: 'TLSv1_method', version: 'TLSv1' }, | 15 | | - { secureProtocol: 'TLSv1_1_method', version: 'TLSv1.1' }, | 16 | | - { secureProtocol: 'TLSv1_2_method', version: 'TLSv1.2' }, | | 14 | + { | | 15 | + secureProtocol: 'TLSv1_method', | | 16 | + version: 'TLSv1', | | 17 | + ciphers: (common.hasOpenSSL31 ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT') | | 18 | + }, { | | 19 | + secureProtocol: 'TLSv1_1_method', | | 20 | + version: 'TLSv1.1', | | 21 | + ciphers: (common.hasOpenSSL31 ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT') | | 22 | + }, { | | 23 | + secureProtocol: 'TLSv1_2_method', | | 24 | + version: 'TLSv1.2' | | 25 | + }, | 17 | 26 | ]; | 18 | 27 |
| 19 | 28 | const serverConfig = { | @@ -30,6 +39,7 @@ const server = tls.createServer(serverConfig, common.mustCall(clientConfigs.leng | 30 | 39 | tls.connect({ | 31 | 40 | host: common.localhostIPv4, | 32 | 41 | port: server.address().port, | | 42 | + ciphers: v.ciphers, | 33 | 43 | rejectUnauthorized: false, | 34 | 44 | secureProtocol: v.secureProtocol | 35 | 45 | }, common.mustCall(function() { | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-tls-min-max-version.js +3Lines changed: 3 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -22,6 +22,9 @@ function test(cmin, cmax, cprot, smin, smax, sprot, proto, cerr, serr) { | 22 | 22 | if (serr !== 'ERR_SSL_UNSUPPORTED_PROTOCOL') | 23 | 23 | ciphers = 'ALL@SECLEVEL=0'; | 24 | 24 | } | | 25 | + if (common.hasOpenSSL31 && cerr === 'ERR_SSL_TLSV1_ALERT_PROTOCOL_VERSION') { | | 26 | + ciphers = 'DEFAULT@SECLEVEL=0'; | | 27 | + } | 25 | 28 | // Report where test was called from. Strip leading garbage from | 26 | 29 | // at Object.<anonymous> (file:line) | 27 | 30 | // from the stack location, we only want the file:line part. | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-tls-session-cache.js +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -100,6 +100,7 @@ function doTest(testOptions, callback) { | 100 | 100 | const args = [ | 101 | 101 | 's_client', | 102 | 102 | '-tls1', | | 103 | + '-cipher', (common.hasOpenSSL31 ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT'), | 103 | 104 | '-connect', `localhost:${this.address().port}`, | 104 | 105 | '-servername', 'ohgod', | 105 | 106 | '-key', fixtures.path('keys/rsa_private.pem'), | |
|