You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error: 140735127326720:error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac #4161
With latest master, I was trying to track down some flakiness in test-tls-inception.js, so I increased the data sent from the socket at the b server like this:
diff --git a/test/parallel/test-tls-inception.js b/test/parallel/test-tls-inception.js
index df03cf9..4dc885d 100644
--- a/test/parallel/test-tls-inception.js
+++ b/test/parallel/test-tls-inception.js
@@ -38,7 +38,7 @@ a = tls.createServer(options, function(socket) {
// the "target" server
b = tls.createServer(options, function(socket) {
- socket.end('hello');
+ socket.end((new Buffer(4000)).fill('a'));
});
process.on('exit', function() {
and got this error:
events.js:141
throw er; // Unhandled 'error' event
^
Error: 140735127326720:error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac:../deps/openssl/openssl/ssl/s3_pkt.c:532:
at Error (native)
Reducing the size of the Buffer to 3000 does not cause the error. Is this expected or a bug?
Ok, so it looks like the cleartext data is probably getting mixed with the underlying TLS exchange somehow (hence the protocol error). To verify this, if you wait until you see the secureConnect event of the second tls.connect() to do socket.end(message); in TLS server b, it will work just fine (you can accomplish this using an event emitter or calling a function that gets set inside b's connection handler that wraps socket.end(message);). Alternatively, wrap the socket.end(message); in a setTimeout() of like 1 second or so for the same effect.
I recieved this today on my heroku server: Aug 23 06:00:00 0c5e4c77-c2c9-445d-aff8-3564937f7520 comicFeed: error We’ve encountered an error: Error: 140094844344192:error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac:../deps/openssl/openssl/ssl/s3_pkt.c:535:
The server is running node 7.10
But I dont have much else to go on.
@vongohren 7.x is unsupported. If you can, consider upgrading to 8.x (which will be supported until the end of 2019). No idea if this will fix your issue, but it's the first thing I'd try.
@petermetz You are using openssl 1.0.2l, but node 8.15.1 uses openssl 1.0.2r. You should ensure that this isn't specific to your non-standard build. Also, the bug fixed here has been backported to 8.15.1, as far as I can see from a quick check, so you should report this as a different bug. It would help to have a reproduction.
npm ERR! code ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
npm ERR! 8896:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:677:
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Satendra singh\AppData\Local\npm-cache\_logs\2021-12-11T05_34_29_970Z-debug.log
npm ERR! code ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
npm ERR! 8896:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:677:
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Satendra singh\AppData\Local\npm-cache\_logs\2021-12-11T05_34_29_970Z-debug.log
npm ERR! code ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
npm ERR! 8896:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:677:
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Satendra singh\AppData\Local\npm-cache\_logs\2021-12-11T05_34_29_970Z-debug.log
What version of Node.js are you running?
Node version is 14,
I have updated node version right now 16,
And in node js version 16
Error is
npm ERR! code ERR_SSL_CIPHER_OPERATION_FAILED
npm ERR! errno ERR_SSL_CIPHER_OPERATION_FAILED
npm ERR! Invalid response body while trying to fetch https://registry.npmjs.org/react-scripts: 3C160000:error:1C800066:Provider routines:ossl_gcm_stream_update:cipher operation failed:c:\ws\deps\openssl\openssl\providers\implementations\ciphers\ciphercommon_gcm.c:312:
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ss719\AppData\Local\npm-cache\_logs\2021-12-12T10_20_04_982Z-debug.log
Activity
jhamhader commentedon Dec 5, 2015
I began investigating this one.
It happens with a buffer or string size >= 3810 and
write()also triggers it.mscdex commentedon Dec 8, 2015
Ok, so it looks like the cleartext data is probably getting mixed with the underlying TLS exchange somehow (hence the protocol error). To verify this, if you wait until you see the
secureConnectevent of the secondtls.connect()to dosocket.end(message);in TLS serverb, it will work just fine (you can accomplish this using an event emitter or calling a function that gets set insideb's connection handler that wrapssocket.end(message);). Alternatively, wrap thesocket.end(message);in asetTimeout()of like 1 second or so for the same effect.mscdex commentedon Dec 8, 2015
/cc @indutny
indutny commentedon Dec 8, 2015
Will look into this tomorrow.
indutny commentedon Dec 8, 2015
Actually, I have a fix for it right now.
tls_wrap: slice buffer properly in `ClearOut`
indutny commentedon Dec 8, 2015
Here you go #4184 . Thanks for figuring it out!
indutny commentedon Dec 8, 2015
Fixed!
tls_wrap: slice buffer properly in `ClearOut`
tls_wrap: slice buffer properly in `ClearOut`
tls_wrap: slice buffer properly in `ClearOut`
tls_wrap: slice buffer properly in `ClearOut`
vongohren commentedon Aug 23, 2017
I recieved this today on my heroku server:
Aug 23 06:00:00 0c5e4c77-c2c9-445d-aff8-3564937f7520 comicFeed: error We’ve encountered an error: Error: 140094844344192:error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac:../deps/openssl/openssl/ssl/s3_pkt.c:535:The server is running node 7.10
But I dont have much else to go on.
Trott commentedon Aug 23, 2017
@vongohren 7.x is unsupported. If you can, consider upgrading to 8.x (which will be supported until the end of 2019). No idea if this will fix your issue, but it's the first thing I'd try.
petermetz commentedon Apr 9, 2019
Just received this on macOS Mojave running Node 8, please see details below:
sam-github commentedon Apr 16, 2019
@petermetz You are using openssl 1.0.2l, but node 8.15.1 uses openssl 1.0.2r. You should ensure that this isn't specific to your non-standard build. Also, the bug fixed here has been backported to 8.15.1, as far as I can see from a quick check, so you should report this as a different bug. It would help to have a reproduction.
satendrasingh51 commentedon Dec 11, 2021
@sam-github @mscdex @silverwind @indutny @Trott
same error on all dependence installation
Trott commentedon Dec 11, 2021
What version of Node.js are you running?
satendrasingh51 commentedon Dec 12, 2021
Node version is 14,
I have updated node version right now 16,
And in node js version 16
Error is
Trott commentedon Dec 12, 2021
Sounds like a network/firewall/proxy problem. If you're on WiFi, maybe try moving to another network.
satendrasingh51 commentedon Dec 12, 2021
But on network change this error
npm ERR! Cannot read properties of undefined (reading 'isServer')Trott commentedon Dec 12, 2021
Maybe try
npm cache clear --force. If that doesn't work, you can try the npm issue tracker , the Node.js help repo, StackOverflow, #node.js channel on libera.chat, or Node.js Slack Community (register at nodeslackers.com). This seems unlikely to be a Node.js core bug.tls_wrap: slice buffer properly in `ClearOut`