| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -56,7 +56,10 @@ const hasCrypto = Boolean(process.versions.openssl) && | |||
| 56 | 56 | !process.env.NODE_SKIP_CRYPTO; | |
| 57 | 57 | ||
| 58 | 58 | const hasOpenSSL3 = hasCrypto && | |
| 59 | - require('crypto').constants.OPENSSL_VERSION_NUMBER >= 805306368; | ||
| 59 | + require('crypto').constants.OPENSSL_VERSION_NUMBER >= 0x30000000; | ||
| 60 | + | ||
| 61 | + const hasOpenSSL31 = hasCrypto && | ||
| 62 | + require('crypto').constants.OPENSSL_VERSION_NUMBER >= 0x30100000; | ||
| 60 | 63 | ||
| 61 | 64 | const hasQuic = hasCrypto && !!process.config.variables.openssl_quic; | |
| 62 | 65 | ||
@@ -898,6 +901,7 @@ const common = { | |||
| 898 | 901 | hasIntl, | |
| 899 | 902 | hasCrypto, | |
| 900 | 903 | hasOpenSSL3, | |
| 904 | + hasOpenSSL31, | ||
| 901 | 905 | hasQuic, | |
| 902 | 906 | hasMultiLocalhost, | |
| 903 | 907 | invalidArgTypeHelper, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -54,6 +54,7 @@ function faultyServer(port) { | |||
| 54 | 54 | function second(server, session) { | |
| 55 | 55 | const req = https.request({ | |
| 56 | 56 | port: server.address().port, | |
| 57 | + ciphers: (common.hasOpenSSL31 ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT'), | ||
| 57 | 58 | rejectUnauthorized: false | |
| 58 | 59 | }, function(res) { | |
| 59 | 60 | res.resume(); | |
| 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) => { | |
| 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() { | |
| 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. | |
| 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'), | |
| Back | FazBrowse Home | New Git URL |
0 commit comments