Hexo部署出现错误 fatal HttpRequestException encountered.

hexo部署到github上的时候突然出现了以下的错误

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
atal: HttpRequestException encountered.
��������ʱ�����
fatal: HttpRequestException encountered.
��������ʱ�����
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': No error
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: fatal: HttpRequestException encountered.
��������ʱ����
fatal: HttpRequestException encountered.
��������ʱ����
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': No error

网上查了一下, 有人说修改目录内_config.yml文件里的github地址将这种形式的 https://github.com/zergtant/zergtant.github.io.git
修改成以下形式 git@github.com:zergtant/zergtant.github.io.git,气质这个根本就是错误的,改了也没用。

因为产生这个根本原因是因为Github最近停用了TLS 1.0和v 1.1 公告在这里 : https://githubengineering.com/crypto-removal-notice/

知道问题了那解决方案就很简单了

1、这里下载最新的 Git Credential Manager for Windows
https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.14.0

2、 替换认证方式
在命令行中输入
git config --global credential.helper wincred

以上两种方法都可解决,第二种在部署时还会提示fatal: HttpRequestException encountered 错误,但是可以提交,所以建议使用第一种。