问题描述
使用 node.js 请求 https 报错如下所示:
INFO fetching issues that have been published on github, please wait...
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
HttpError: request to https://api.github.com/repos/holdyounger/ScopeBlog/issues failed, reason: unable to verify the first certificate
at D:\Documents\Source\node_modules\@octokit\request\dist-node\index.js:108:11
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.next (D:\Documents\Source\node_modules\@octokit\plugin-paginate-rest\dist-node\index.js:112:28)
at async GithubApi.fetchAllIssues (D:\Documents\Source\node_modules\hexo-auto-issue\lib\githubApi.js:20:22)
at async module.exports (D:\Documents\Source\node_modules\hexo-auto-issue\lib\index.js:14:22)
解决办法
set NODE_TLS_REJECT_UNAUTHORIZED=0