You need to sign in or sign up before continuing.
Commit 479d0773 authored by nanahira's avatar nanahira

ignore cert error

parent 7564f0a5
Pipeline #16318 passed with stages
in 32 seconds
...@@ -8,6 +8,7 @@ import { assert } from 'console'; ...@@ -8,6 +8,7 @@ import { assert } from 'console';
import { ping } from 'icmp'; import { ping } from 'icmp';
import delay from 'delay'; import delay from 'delay';
import PQueue from 'p-queue'; import PQueue from 'p-queue';
import https from 'https';
interface Source { interface Source {
protocol: string; protocol: string;
...@@ -79,6 +80,11 @@ enum ConnectResult { ...@@ -79,6 +80,11 @@ enum ConnectResult {
} }
class Checker { class Checker {
private http = axios.create({
httpsAgent: new https.Agent({
rejectUnauthorized: false,
}),
});
private client: Aliyun; private client: Aliyun;
private cdnRecordsRegex: RegExp[]; private cdnRecordsRegex: RegExp[];
static order = 0; static order = 0;
...@@ -193,7 +199,7 @@ class Checker { ...@@ -193,7 +199,7 @@ class Checker {
private async connectHttpProcess(url: string, hostHeader: string) { private async connectHttpProcess(url: string, hostHeader: string) {
try { try {
await axios.get(url, { await this.http.get(url, {
headers: { Host: hostHeader }, headers: { Host: hostHeader },
timeout: this.config.timeout, timeout: this.config.timeout,
validateStatus: (status) => status < 500, validateStatus: (status) => status < 500,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment