浏览代码

Решение проблемы 'unable to verify the first certificate' для некоторых сайтов с валидным сертификатом

Book Pauk 2 年之前
父节点
当前提交
c8f97ef386
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      server/core/FileDownloader.js

+ 4 - 0
server/core/FileDownloader.js

@@ -1,3 +1,4 @@
+const https = require('https');
 const axios = require('axios');
 const utils = require('./utils');
 
@@ -16,6 +17,9 @@ class FileDownloader {
                 'user-agent': userAgent,
                 timeout: 300*1000,
             },
+            httpsAgent: new https.Agent({
+                rejectUnauthorized: false // решение проблемы 'unable to verify the first certificate' для некоторых сайтов с валидным сертификатом
+            }),
             responseType: 'stream',
         };