Browse Source

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

Book Pauk 2 years ago
parent
commit
c8f97ef386
1 changed files with 4 additions and 0 deletions
  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',
         };