This commit is contained in:
xiaojunnuo
2026-04-19 12:25:28 +08:00
parent eb6ca96e85
commit 94fd5bd7ec
@@ -89,19 +89,19 @@ export class SiteTester {
// 创建 HTTPS 请求
const requestPromise = safePromise((resolve, reject) => {
const req = https.request(options, res => {
// // 获取证书
// // @ts-ignore
// const certificate = res.socket.getPeerCertificate();
// // logger.info('证书信息', certificate);
// if (certificate.subject == null) {
// logger.warn("证书信息为空");
// resolve({
// certificate: null
// });
// }
// resolve({
// certificate
// });
// 获取证书
// @ts-ignore
const certificate = res.socket.getPeerCertificate();
// logger.info('证书信息', certificate);
if (certificate.subject == null) {
logger.warn("证书信息为空");
resolve({
certificate: null
});
}
resolve({
certificate
});
res.socket.end();
// 关闭响应
res.destroy();
@@ -117,6 +117,11 @@ export class SiteTester {
resolve({
certificate
});
}else{
logger.warn("证书信息为空");
resolve({
certificate: null
});
}
});
});