Skip to content

Commit

Permalink
Fix: Fix incorrect error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
cch-aecomhk committed Jul 23, 2021
1 parent 4d262bb commit 6b72d50
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions server/util-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ exports.checkCertificate = function (res) {
} = res.request.res.socket.getPeerCertificate(false);

if (!valid_from || !valid_to || !subjectaltname) {
reject(new Error('No certificate'));
return;
throw { message: 'No TLS certificate in response' };
}

const valid = res.request.res.socket.authorized || false;
Expand Down

0 comments on commit 6b72d50

Please sign in to comment.