mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-27 16:54:04 +00:00
Handle unexpected error of checkCertificate
This commit is contained in:
parent
39987ba9ac
commit
466b403a96
1 changed files with 4 additions and 0 deletions
|
@ -470,6 +470,10 @@ const parseCertificateInfo = function (info) {
|
|||
* @returns {Object} Object containing certificate information
|
||||
*/
|
||||
exports.checkCertificate = function (res) {
|
||||
if (!res.request.res.socket) {
|
||||
throw new Error("No socket found");
|
||||
}
|
||||
|
||||
const info = res.request.res.socket.getPeerCertificate(true);
|
||||
const valid = res.request.res.socket.authorized || false;
|
||||
|
||||
|
|
Loading…
Reference in a new issue