mirror of
https://github.com/certd/certd.git
synced 2026-04-24 12:27:25 +08:00
chore: 1
This commit is contained in:
@@ -89,19 +89,19 @@ export class SiteTester {
|
|||||||
// 创建 HTTPS 请求
|
// 创建 HTTPS 请求
|
||||||
const requestPromise = safePromise((resolve, reject) => {
|
const requestPromise = safePromise((resolve, reject) => {
|
||||||
const req = https.request(options, res => {
|
const req = https.request(options, res => {
|
||||||
// // 获取证书
|
// 获取证书
|
||||||
// // @ts-ignore
|
// @ts-ignore
|
||||||
// const certificate = res.socket.getPeerCertificate();
|
const certificate = res.socket.getPeerCertificate();
|
||||||
// // logger.info('证书信息', certificate);
|
// logger.info('证书信息', certificate);
|
||||||
// if (certificate.subject == null) {
|
if (certificate.subject == null) {
|
||||||
// logger.warn("证书信息为空");
|
logger.warn("证书信息为空");
|
||||||
// resolve({
|
resolve({
|
||||||
// certificate: null
|
certificate: null
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
// resolve({
|
resolve({
|
||||||
// certificate
|
certificate
|
||||||
// });
|
});
|
||||||
res.socket.end();
|
res.socket.end();
|
||||||
// 关闭响应
|
// 关闭响应
|
||||||
res.destroy();
|
res.destroy();
|
||||||
@@ -117,6 +117,11 @@ export class SiteTester {
|
|||||||
resolve({
|
resolve({
|
||||||
certificate
|
certificate
|
||||||
});
|
});
|
||||||
|
}else{
|
||||||
|
logger.warn("证书信息为空");
|
||||||
|
resolve({
|
||||||
|
certificate: null
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user