HCLonely / AWA-Helper

外星人论坛自动任务助手
https://github.com/HCLonely/AWA-Helper
45 stars 4 forks source link

使用twitch功能时提示: unable to verify the first certificate #56

Open Noomob opened 3 months ago

Noomob commented 3 months ago

问题描述: 首次使用awa做twitch任务时发生了这个错误,使用steamcommunity 302代理,网页观看twitch和完成任务都没问题,试着取消ssl验证npm config set strict-ssl false但没能解决问题。

问题报错: unable to verify the first certificate

相关 Logs: pv [Error]: unable to verify the first certificate at pv.from (output/main.js:1:632642) at Zg. (output/main.js:1:655007) at Zg.emit (node:events:531:35) at Gg.forEach.Wg. (output/main.js:1:618625) at ClientRequest.emit (node:events:519:28) at TLSSocket.socketErrorListener (node:_http_client:500:9) at TLSSocket.emit (node:events:519:28) at emitErrorNT (node:internal/streams/destroy:169:8) at emitErrorCloseNT (node:internal/streams/destroy:128:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) at By.request (output/main.js:1:663577) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async output/main.js:1:1346500 at async By.request (output/main.js:1:663484) at async output/main.js:1:1346500 at async By.request (output/main.js:1:663484) at async output/main.js:1:1346500 at async By.request (output/main.js:1:663484) at async VG.TwitchTrack.init (output/main.js:1:1481636) at async E.startHelper (output/main.js:1:2345294) { code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, adapter: [ 'xhr', 'http' ], transformRequest: [ [Function (anonymous)] ], transformResponse: [ [Function (anonymous)] ], timeout: 300000, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: [Function], Blob: [class Blob] }, validateStatus: [Function: validateStatus], headers: Object [AxiosHeaders] { Accept: 'application/json, text/plain, /', 'Content-Type': undefined, Host: 'www.twitch.tv', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36 Edg/103.0.1264.77', 'Accept-Encoding': 'gzip, compress, deflate, br' }, maxRedirects: 5, url: 'https://www.twitch.tv/', method: 'get', Logger: e { id: 1720315609410, data: '\x1B[90m[2024-07-07 09:26:49] \x1B[39m\x1B[33m正在重试第 \x1B[34m3\x1B[39m\x1B[33m 次...\x1B[39m\x1B[31mError(0)\x1B[39m: \x1B[33m证书错误,请尝试更换代理或节点!\x1B[39m' }, retryCount: 3, data: undefined }, request: <ref *1> Writable { _events: { close: undefined, error: [Function (anonymous)], prefinish: undefined, finish: undefined, drain: undefined, response: [Function (anonymous)], socket: [Array], timeout: undefined, abort: undefined }, _writableState: WritableState { highWaterMark: 16384, length: 0, corked: 0, onwrite: [Function: bound onwrite], writelen: 0, bufferedIndex: 0, pendingcb: 0,

  [Symbol(kBufferedValue)]: null
},
_maxListeners: undefined,
_options: {
  maxRedirects: 5,
  maxBodyLength: Infinity,
  protocol: 'https:',
  path: '/',
  method: 'GET',
  headers: [Object: null prototype],
  agents: [Object],
  auth: undefined,
  family: undefined,
  beforeRedirect: [Function: by],
  beforeRedirects: [Object],
  hostname: 'www.twitch.tv',
  port: '',
  agent: undefined,
  nativeProtocols: [Object],
  pathname: '/'
},
_ended: true,
_ending: true,
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 0,
_requestBodyBuffers: [],
_eventsCount: 3,
_onNativeResponse: [Function (anonymous)],
_currentRequest: ClientRequest {
  _events: [Object: null prototype],
  _eventsCount: 7,
  _maxListeners: undefined,
  outputData: [],
  outputSize: 0,
  writable: true,
  destroyed: false,
  _last: true,
  chunkedEncoding: false,
  shouldKeepAlive: true,
  maxRequestsOnConnectionReached: false,
  _defaultKeepAlive: true,
  useChunkedEncodingByDefault: false,
  sendDate: false,
  _removedConnection: false,
  _removedContLen: false,
  _removedTE: false,
  strictContentLength: false,
  _contentLength: 0,
  _hasBody: true,
  _trailer: '',
  finished: true,
  _headerSent: true,
  _closed: false,
  _header: 'GET / HTTP/1.1\r\n' +
    'Accept: application/json, text/plain, */*\r\n' +
    'Host: www.twitch.tv\r\n' +
    'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36 Edg/103.0.1264.77\r\n' +
    'Accept-Encoding: gzip, compress, deflate, br\r\n' +
    'Connection: keep-alive\r\n' +
    '\r\n',
  _keepAliveTimeout: 0,
  _onPendingData: [Function: nop],
  agent: [Agent],
  socketPath: undefined,
  method: 'GET',
  maxHeaderSize: undefined,
  insecureHTTPParser: undefined,
  joinDuplicateHeaders: undefined,
  path: '/',
  _ended: false,
  res: null,
  aborted: false,
  timeoutCb: [Function: emitRequestTimeout],
  upgradeOrConnect: false,
  parser: null,
  maxHeadersCount: null,
  reusedSocket: false,
  host: 'www.twitch.tv',
  protocol: 'https:',
  _redirectable: [Circular *1],
  [Symbol(shapeMode)]: false,
  [Symbol(kCapture)]: false,
  [Symbol(kBytesWritten)]: 0,
  [Symbol(kNeedDrain)]: false,
  [Symbol(corked)]: 0,
  [Symbol(kChunkedBuffer)]: [],
  [Symbol(kChunkedLength)]: 0,
  [Symbol(kSocket)]: [TLSSocket],
  [Symbol(kOutHeaders)]: [Object: null prototype],
  [Symbol(errored)]: null,
  [Symbol(kHighWaterMark)]: 16384,
  [Symbol(kRejectNonStandardBodyWrites)]: false,
  [Symbol(kUniqueHeaders)]: null
},
_currentUrl: 'https://www.twitch.tv/',
_timeout: null,
[Symbol(shapeMode)]: true,
[Symbol(kCapture)]: false

}, cause: Error: unable to verify the first certificate at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34) at TLSSocket.emit (node:events:519:28) at TLSSocket._finishInit (node:_tls_wrap:1085:8) at ssl.onhandshakedone (node:_tls_wrap:871:12) { code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE' }

HCLonely commented 3 months ago

更换代理试试

HCLonely commented 3 months ago

或配置文件修改TLSRejectUnauthorized选项

HCLonely commented 1 week ago

This issue is stale because it has been open for 60 days with no activity.