chore(fetcher): disable TLS verification
to better deal with hoster quirks
This commit is contained in:
parent
e5d68c5214
commit
281fe00a35
1 changed files with 6 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
/* istanbul ignore file */
|
||||
import { Agent as HttpsAgent } from 'node:https';
|
||||
import { Mutex, Semaphore, SemaphoreInterface, withTimeout } from 'async-mutex';
|
||||
import { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
||||
import { Cacheable, CacheableMemory, Keyv } from 'cacheable';
|
||||
|
|
@ -186,6 +187,7 @@ export class Fetcher {
|
|||
...requestConfig?.headers,
|
||||
},
|
||||
...(proxyUrl && this.getProxyConfig(proxyUrl)),
|
||||
...(!proxyUrl && { httpsAgent: new HttpsAgent({ rejectUnauthorized: false }) }),
|
||||
url: finalUrl.href,
|
||||
timeout: this.DEFAULT_TIMEOUT,
|
||||
transformResponse: [data => data],
|
||||
|
|
@ -364,9 +366,12 @@ export class Fetcher {
|
|||
let proxyConfig = this.proxyConfig.get(proxyUrl.href);
|
||||
|
||||
if (!proxyConfig) {
|
||||
const httpsAgent = proxyUrl.protocol === 'socks5:' ? new SocksProxyAgent(proxyUrl) : new HttpsProxyAgent(proxyUrl);
|
||||
httpsAgent.options.rejectUnauthorized = false;
|
||||
|
||||
proxyConfig = {
|
||||
httpAgent: proxyUrl.protocol === 'socks5:' ? new SocksProxyAgent(proxyUrl) : new HttpProxyAgent(proxyUrl),
|
||||
httpsAgent: proxyUrl.protocol === 'socks5:' ? new SocksProxyAgent(proxyUrl) : new HttpsProxyAgent(proxyUrl),
|
||||
httpsAgent,
|
||||
proxy: false,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue