【Error】unable to verify the first certificate

文章讲述了在使用Node.js进行HTTPS请求时遇到的错误,具体表现为HttpError,原因是无法验证证书。解决方案是设置NODE_TLS_REJECT_UNAUTHORIZED环境变量为0。涉及的库包括@octokit和Hexo的githubAPI。
摘要由CSDN通过智能技术生成

问题描述

使用 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
  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

欧恩意

如有帮助,感谢打赏!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值