| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c1f6ba2 commit 2ba124f
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3132,6 +3132,13 @@ Failed to set PSK identity hint. Hint may be too long. | |||
| 3132 | 3132 | An attempt was made to renegotiate TLS on a socket instance with renegotiation | |
| 3133 | 3133 | disabled. | |
| 3134 | 3134 | ||
| 3135 | + <a id="ERR_TLS_RENEGOTIATION_UNSUPPORTED"></a> | ||
| 3136 | + | ||
| 3137 | + ### `ERR_TLS_RENEGOTIATION_UNSUPPORTED` | ||
| 3138 | + | ||
| 3139 | + An attempt was made to renegotiate TLS, but the TLS implementation does not | ||
| 3140 | + support caller-initiated renegotiation. | ||
| 3141 | + | ||
| 3135 | 3142 | <a id="ERR_TLS_REQUIRED_SERVER_NAME"></a> | |
| 3136 | 3143 | ||
| 3137 | 3144 | ### `ERR_TLS_REQUIRED_SERVER_NAME` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1843,6 +1843,8 @@ E('ERR_TLS_PROTOCOL_VERSION_CONFLICT', | |||
| 1843 | 1843 | 'TLS protocol version %j conflicts with secureProtocol %j', TypeError); | |
| 1844 | 1844 | E('ERR_TLS_RENEGOTIATION_DISABLED', | |
| 1845 | 1845 | 'TLS session renegotiation disabled for this socket', Error); | |
| 1846 | + E('ERR_TLS_RENEGOTIATION_UNSUPPORTED', | ||
| 1847 | + 'TLS session renegotiation is unsupported by this TLS implementation', Error); | ||
| 1846 | 1848 | ||
| 1847 | 1849 | // This should probably be a `TypeError`. | |
| 1848 | 1850 | E('ERR_TLS_REQUIRED_SERVER_NAME', | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -72,6 +72,7 @@ const { | |||
| 72 | 72 | ERR_TLS_INVALID_CONTEXT, | |
| 73 | 73 | ERR_TLS_INVALID_STATE, | |
| 74 | 74 | ERR_TLS_RENEGOTIATION_DISABLED, | |
| 75 | + ERR_TLS_RENEGOTIATION_UNSUPPORTED, | ||
| 75 | 76 | ERR_TLS_REQUIRED_SERVER_NAME, | |
| 76 | 77 | ERR_TLS_SESSION_ATTACK, | |
| 77 | 78 | ERR_TLS_SNI_FROM_SERVER, | |
@@ -1014,8 +1015,13 @@ TLSSocket.prototype.renegotiate = function(options, callback) { | |||
| 1014 | 1015 | try { | |
| 1015 | 1016 | this._handle.renegotiate(); | |
| 1016 | 1017 | } catch (err) { | |
| 1018 | + const isBoringSSLRenegotiationUnsupported = | ||
| 1019 | + process.features.openssl_is_boringssl && | ||
| 1020 | + err?.code === 'ERR_SSL_FUNCTION_SHOULD_NOT_HAVE_BEEN_CALLED'; | ||
| 1021 | + const error = isBoringSSLRenegotiationUnsupported ? | ||
| 1022 | + new ERR_TLS_RENEGOTIATION_UNSUPPORTED() : err; | ||
| 1017 | 1023 | if (callback) { | |
| 1018 | - process.nextTick(callback, err); | ||
| 1024 | + process.nextTick(callback, error); | ||
| 1019 | 1025 | } | |
| 1020 | 1026 | return false; | |
| 1021 | 1027 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,14 +32,22 @@ connect({ | |||
| 32 | 32 | assert.strictEqual(client.getProtocol(), 'TLSv1.3'); | |
| 33 | 33 | ||
| 34 | 34 | const ok = client.renegotiate({}, common.mustCall((err) => { | |
| 35 | - assert.throws(() => { throw err; }, { | ||
| 36 | - message: hasOpenSSL3 ? | ||
| 37 | - 'error:0A00010A:SSL routines::wrong ssl version' : | ||
| 38 | - 'error:1420410A:SSL routines:SSL_renegotiate:wrong ssl version', | ||
| 39 | - code: 'ERR_SSL_WRONG_SSL_VERSION', | ||
| 40 | - library: 'SSL routines', | ||
| 41 | - reason: 'wrong ssl version', | ||
| 42 | - }); | ||
| 35 | + if (process.features.openssl_is_boringssl) { | ||
| 36 | + assert.throws(() => { throw err; }, { | ||
| 37 | + message: 'TLS session renegotiation is unsupported by this TLS ' + | ||
| 38 | + 'implementation', | ||
| 39 | + code: 'ERR_TLS_RENEGOTIATION_UNSUPPORTED', | ||
| 40 | + }); | ||
| 41 | + } else { | ||
| 42 | + assert.throws(() => { throw err; }, { | ||
| 43 | + message: hasOpenSSL3 ? | ||
| 44 | + 'error:0A00010A:SSL routines::wrong ssl version' : | ||
| 45 | + 'error:1420410A:SSL routines:SSL_renegotiate:wrong ssl version', | ||
| 46 | + code: 'ERR_SSL_WRONG_SSL_VERSION', | ||
| 47 | + library: 'SSL routines', | ||
| 48 | + reason: 'wrong ssl version', | ||
| 49 | + }); | ||
| 50 | + } | ||
| 43 | 51 | cleanup(); | |
| 44 | 52 | })); | |
| 45 | 53 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments