Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

所有请求502, unable to verify the first certificate #1070

Closed
hxfdean opened this issue Dec 27, 2020 · 4 comments
Closed

所有请求502, unable to verify the first certificate #1070

hxfdean opened this issue Dec 27, 2020 · 4 comments

Comments

@hxfdean
Copy link

hxfdean commented Dec 27, 2020

环境

  • 系统/平台: raspberry pi4 Raspian 系统桌面版

  • nodejs 版本: 16.12.1

  • API版本:3.47.5

出现问题

mpm install 后 node app.js 运行起来了,但是点击网页端搜索,控制台输出
pi@raspberrypi:~/NeteaseCloudMusicApi $ node app.js
server running @ http://localhost:3000
[ERR] /search?keywords=海阔天空 {
status: 502,
body: {
code: 502,
msg: Error: unable to verify the first certificate
at TLSSocket.onConnectSecure (_tls_wrap.js:1473:34)
at TLSSocket.emit (events.js:311:20)
at TLSSocket._finishInit (_tls_wrap.js:916:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:686:12) {
code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
config: [Object],
request: [Writable],
response: undefined,
isAxiosError: true,
toJSON: [Function: toJSON]
}
}
}
(node:7410) 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 ()
at stringify (/home/pi/NeteaseCloudMusicApi/node_modules/express/lib/response.js:1123:12)
at ServerResponse.json (/home/pi/NeteaseCloudMusicApi/node_modules/express/lib/response.js:260:14)
at ServerResponse.send (/home/pi/NeteaseCloudMusicApi/node_modules/express/lib/response.js:158:21)
at /home/pi/NeteaseCloudMusicApi/app.js:105:37
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:7410) 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: 2)
(node:7410) [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.

重现步骤

mpm install 后 node app.js 运行起来了,但是点击网页端搜索

期待效果

不再出现502错误,并能正常运行

@Binaryify
Copy link
Owner

#1006

@hxfdean
Copy link
Author

hxfdean commented Dec 27, 2020

你好,大佬,linux我是小白,
export NODE_TLS_REJECT_UNAUTHORIZED=0
这句是控制台执行还是加在哪个文件的哪里?是用这行代码解决问题吗?求明示,整了两天了,都困在这里,重新安装了N次了

@Binaryify
Copy link
Owner

Binaryify commented Dec 27, 2020

控制台执行,windows 下应该是 set NODE_TLS_REJECT_UNAUTHORIZED=0,Linux 和 mac是export NODE_TLS_REJECT_UNAUTHORIZED=0

@hxfdean
Copy link
Author

hxfdean commented Dec 28, 2020

多谢 Binaryify 大佬,就是这个,已经在window 成功运行起来了,感谢感谢~!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants