| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8a8ac8c commit bec0421
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -238,7 +238,7 @@ assert.throws(function() { | |||
| 238 | 238 | // Throws crypto error, so there is an opensslErrorStack property. | |
| 239 | 239 | // The openSSL stack should have content. | |
| 240 | 240 | if ((err instanceof Error) && | |
| 241 | - /asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag/.test(err) && | ||
| 241 | + /asn1 encoding routines:[^:]*:wrong tag/.test(err) && | ||
| 242 | 242 | err.opensslErrorStack !== undefined && | |
| 243 | 243 | Array.isArray(err.opensslErrorStack) && | |
| 244 | 244 | err.opensslErrorStack.length > 0) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,7 +21,9 @@ server.listen(0, function() { | |||
| 21 | 21 | req.end(); | |
| 22 | 22 | ||
| 23 | 23 | req.once('error', common.mustCall(function(err) { | |
| 24 | - assert(/unknown protocol/.test(err.message)); | ||
| 24 | + // OpenSSL 1.0.x and 1.1.x use different error messages for junk inputs. | ||
| 25 | + assert(/unknown protocol/.test(err.message) || | ||
| 26 | + /wrong version number/.test(err.message)); | ||
| 25 | 27 | server.close(); | |
| 26 | 28 | })); | |
| 27 | 29 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,6 +46,8 @@ process.on('exit', function() { | |||
| 46 | 46 | common.printSkipMessage('`openssl s_client -ssl3` not supported.'); | |
| 47 | 47 | } else { | |
| 48 | 48 | assert.strictEqual(errors.length, 1); | |
| 49 | - assert(/:wrong version number/.test(errors[0].message)); | ||
| 49 | + // OpenSSL 1.0.x and 1.1.x report invalid client versions differently. | ||
| 50 | + assert(/:wrong version number/.test(errors[0].message) || | ||
| 51 | + /:version too low/.test(errors[0].message)); | ||
| 50 | 52 | } | |
| 51 | 53 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,8 +20,10 @@ const server = tls.createServer({}) | |||
| 20 | 20 | }).on('tlsClientError', common.mustCall(function(e) { | |
| 21 | 21 | assert.ok(e instanceof Error, | |
| 22 | 22 | 'Instance of Error should be passed to error handler'); | |
| 23 | + // OpenSSL 1.0.x and 1.1.x use different error codes for junk inputs. | ||
| 23 | 24 | assert.ok( | |
| 24 | - /SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol/.test(e.message), | ||
| 25 | + /SSL routines:[^:]*:(unknown protocol|wrong version number)/.test( | ||
| 26 | + e.message), | ||
| 25 | 27 | 'Expecting SSL unknown protocol'); | |
| 26 | 28 | ||
| 27 | 29 | server.close(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,8 +20,10 @@ const server = net.createServer(function(c) { | |||
| 20 | 20 | s.on('error', common.mustCall(function(e) { | |
| 21 | 21 | assert.ok(e instanceof Error, | |
| 22 | 22 | 'Instance of Error should be passed to error handler'); | |
| 23 | + // OpenSSL 1.0.x and 1.1.x use different error codes for junk inputs. | ||
| 23 | 24 | assert.ok( | |
| 24 | - /SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol/.test(e.message), | ||
| 25 | + /SSL routines:[^:]*:(unknown protocol|wrong version number)/.test( | ||
| 26 | + e.message), | ||
| 25 | 27 | 'Expecting SSL unknown protocol'); | |
| 26 | 28 | })); | |
| 27 | 29 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments