diff options
author | Fedor Indutny <fedor@indutny.com> | 2016-05-19 20:25:05 -0400 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2016-05-25 16:07:30 -0400 |
commit | 9cac8c894eb16195578311ab98bc4169fa38a3db (patch) | |
tree | 2ad1195da3b8c0ea065a1c5402f6455f8c55b461 /lib | |
parent | c9a5990a76ccb15872234948e23bdc12691c2e70 (diff) | |
download | android-node-v8-9cac8c894eb16195578311ab98bc4169fa38a3db.tar.gz android-node-v8-9cac8c894eb16195578311ab98bc4169fa38a3db.tar.bz2 android-node-v8-9cac8c894eb16195578311ab98bc4169fa38a3db.zip |
tls: catch `certCbDone` exceptions
Catch and emit `certCbDone` exceptions instead of throwing them as
`uncaughtException` and crashing the whole process.
Fix: https://github.com/nodejs/node/issues/6822
PR-URL: https://github.com/nodejs/node/pull/6887
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/_tls_wrap.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 029d9ac26f..cdb5817fa6 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -171,7 +171,11 @@ function oncertcb(info) { if (!self._handle) return self.destroy(new Error('Socket is closed')); - self._handle.certCbDone(); + try { + self._handle.certCbDone(); + } catch (e) { + self.destroy(e); + } }); }); } |