Binaryify / NeteaseCloudMusicApi

网易云音乐 Node.js API service
https://gitlab.com/Binaryify/neteasecloudmusicapi
30.29k stars 15.78k forks source link

502 unable to verify the first certificate #1147

Open zhengdechang opened 3 years ago

zhengdechang commented 3 years ago

[ERR] /search?keywords=海阔天空 { status: 502, body: { code: 502, msg: Error: unable to verify the first certificate at TLSSocket.onConnectSecure (_tls_wrap.js:1497:34) at TLSSocket.emit (events.js:315:20) at TLSSocket._finishInit (_tls_wrap.js:932:8) at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:706:12) { code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', config: [Object], request: [Writable], response: undefined, isAxiosError: true, toJSON: [Function: toJSON] } } } (node:8964) UnhandledPromiseRejectionWarning: TypeError: Converting circular structure to JSON --> starting at object with constructor 'Object' | property 'httpsAgent' -> object with constructor 'Agent' | property 'sockets' -> object with constructor 'Object' | ... | property 'errored' -> object with constructor 'Object' --- property 'config' closes the circle at JSON.stringify () at stringify (F:\elemusic\NeteaseCloudMusicApi\node_modules_express@4.17.1@express\lib\response.js:1123:12) at ServerResponse.json (F:\elemusic\NeteaseCloudMusicApi\node_modules_express@4.17.1@express\lib\response.js:260:14) at ServerResponse.send (F:\elemusic\NeteaseCloudMusicApi\node_modules_express@4.17.1@express\lib\response.js:158:21) at F:\elemusic\NeteaseCloudMusicApi\app.js:105:37 at processTicksAndRejections (internal/process/task_queues.js:93:5) (Use node --trace-warnings ... to show where the warning was created) (node:8964) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a pr omise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.h tml#cli_unhandled_rejections_mode). (rejection id: 2) (node:8964) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non -zero exit code.

zhengdechang commented 3 years ago

这个问题能帮我再看看吗,搞了两天了没有任何进展

Binaryify commented 3 years ago

https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1070 试试

Coloryr commented 3 years ago

同,就算加上了

D:\NeteaseCloudMusicApi>set NODE_TLS_REJECT_UNAUTHORIZED=0

D:\NeteaseCloudMusicApi>set PORT=4000

D:\NeteaseCloudMusicApi>.\node\node app.js

一样会502

[ERR] /lyric?id=414118123 {
  status: 502,
  body: {
    code: 502,
    msg: Error: read ECONNRESET
        at TLSWrap.onStreamRead (internal/stream_base_commons.js:207:27) {
      errno: -4077,
      code: 'ECONNRESET',
      syscall: 'read',
      config: [Object],
      request: [Writable],
      response: undefined,
      isAxiosError: true,
      toJSON: [Function: toJSON]
    }
  }
}
(node:38236) UnhandledPromiseRejectionWarning: TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'TLSSocket'
    |     property '_httpMessage' -> object with constructor 'ClientRequest'
    --- property 'socket' closes the circle
    at JSON.stringify (<anonymous>)
    at stringify (D:\NeteaseCloudMusicApi\node_modules\express\lib\response.js:1123:12)
    at ServerResponse.json (D:\NeteaseCloudMusicApi\node_modules\express\lib\response.js:260:14)
    at ServerResponse.send (D:\NeteaseCloudMusicApi\node_modules\express\lib\response.js:158:21)
    at D:\NeteaseCloudMusicApi\app.js:106:37
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:38236) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)
Coloryr commented 3 years ago

有时候可以有时候又不行

chaos-zhu commented 1 year ago

在项目app.js中加入,然后重启解决了... process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0

zhengdechang commented 1 year ago

我重装系统之后就可以了 又是玄学问题