|
|
|
@@ -91,7 +91,9 @@ function checkCertExpiry (domain) { |
|
|
|
agent: new https.Agent({ rejectUnauthorized: false }) // 避免自签名证书报错 |
|
|
|
}, (res) => { |
|
|
|
const cert = res.socket.getPeerCertificate(); |
|
|
|
if (cert.valid_to) { |
|
|
|
console.log(cert); |
|
|
|
let subjectaltname = cert.subjectaltname ? cert.subjectaltname.replace('DNS:', '') : ''; |
|
|
|
if (cert.valid_to && subjectaltname == domain) { |
|
|
|
resolve(cert.valid_to); |
|
|
|
} else { |
|
|
|
reject(new Error('证书信息缺失')); |
|
|
|
|