Hexo-OpenSSL SSL_connect: Connection was reset in connection to github.com:443


OpenSSL SSL_connect: Connection was reset in connection to github.com:443

这两天上传写好的 Github 博客,hexo d 部署的时候总是遇到问题,这里记录一下:

报错信息

[master 6cc1073] Site updated: 2021-03-19 21:46:59
 26 files changed, 285 insertions(+), 285 deletions(-)
fatal: unable to access 'https://github.com/terence1023/terence1023.github.io.git/': OpenSSL SSL_connect: Connection was reset in connection to github.com:443
FATAL {
  err: Error: Spawn failed
      at ChildProcess.<anonymous> (D:\GitHubBlog\blog\node_modules\hexo-deployer-git\node_modules\hexo-util\lib\spawn.js:51:21)
      at ChildProcess.emit (node:events:376:20)
      at ChildProcess.cp.emit (D:\GitHubBlog\blog\node_modules\cross-spawn\lib\enoent.js:34:29)
      at Process.ChildProcess._handle.onexit (node:internal/child_process:277:12) {
    code: 128
  }
} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html

解决方案一:

配置 git 的代理

git config —global http.proxy “127.0.0.1:1080”
git config —global https.proxy “127.0.0.1:1080”

这里,梯子要始终开着,这个方法昨天还可以,今天就不行了。

解决方案二:

关于SSL,主流的解决办法是把SSL验证设为false:

git config --global http.sslVerify "false"

(如果还有问题,就接着更新,以上解决方案均是在梯子开着的情况下操作

没救了,这篇还没 hexo d 上去就要接着修改了

解决方案三:

1. 使用 hexo v 查看版本信息

PS C:\Users\Administrator> hexo v
hexo-cli: 4.2.0
os: Windows_NT 10.0.19042 win32 x64
node: 15.3.0
v8: 8.6.395.17-node.22
uv: 1.40.0
zlib: 1.2.11
brotli: 1.0.9
ares: 1.16.1
modules: 88
nghttp2: 1.41.0
napi: 7
llhttp: 2.1.3
openssl: 1.1.1g
cldr: 37.0
icu: 67.1
tz: 2020a
unicode: 13.0

现在来到你的博客所在的文件夹根目录中打开 _config.yml 文件

2. 查看原始的 [deploy]

# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
  type: git
  repo: https://github.com/terence1023/terence1023.github.io.git
  branch: main

3. 因为 Hexo 版本更新,我们需要修改这个文件,修改后

# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
  type: git
  # repo: https://github.com/terence1023/terence1023.github.io.git
  repo: git@github.com:terence1023/terence1023.github.io.git
  branch: main

再次去执行 hexo d 就可以了

参考链接


文章作者: Terence Cai
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 Terence Cai !
  目录