From ef4e39df9586291209b7384da239d6def5087795 Mon Sep 17 00:00:00 2001 From: reklatsmasters Date: Sun, 9 Sep 2018 22:30:01 +0500 Subject: [PATCH] Ignore decryption errors. Related #8. --- src/node_modules/filter/decoder.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/node_modules/filter/decoder.js b/src/node_modules/filter/decoder.js index b7237e3..35ffbf3 100644 --- a/src/node_modules/filter/decoder.js +++ b/src/node_modules/filter/decoder.js @@ -51,9 +51,13 @@ module.exports = class Decoder extends Transform { const isCipher = record.type === contentType.CHANGE_CIPHER_SPEC; if (!isAlert && !isCipher) { - debug('decrypt record layer'); - this.session.decrypt(record); - debug('decryption success'); + try { + debug('decrypt record layer'); + this.session.decrypt(record); + debug('decryption success'); + } catch (err) { + debug('decryption error, ignore'); + } } if (isHandshake) {