转载From: 修电脑的裁缝酱 ,博客链接为 http://blog.youkuaiyun.com/huihut 出处:https://blog.youkuaiyun.com/huihut/article/details/79404421
报错
git push 到 Github 的时候出现异常:
fatal: unable to access 'https://github.com/huihut/interview.git/': error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
Pushing to https://github.com/huihut/interview.git
- 1
- 2
原因
在 2018年2月22日19:00 UTC(太平洋标准时间上午11:00),GitHub 停止了对加密弱 TLS 1.0 和 1.1 协议的支持,并且仅支持与 TLS 1.2 协议的连接。
官方声明:
Github . Weak cryptographic standards removal notice
因此,如果你的 git 连接方式仍然是 TLS 1.0 或 1.1,则会报错。
解决
① 查看你的 TLS 版本
git config --global --list
- 1
② 如果仍然是 TLS 1.0 或 1.1,则下载更新 Git 最新版:https://git-scm.com/
③ 安装好最新版 Git 后,更新 TLS
git config --global --unset http.sslVersion
git config --global --add http.sslVersion tlsv1.2
- 1
- 2
④ 现在则可以使用 TLS 1.2 传输,并解决此问题
操作如下图:

Git推送到GitHub错误修复
本文介绍了当使用Git推送代码到GitHub时遇到的错误:fatal: unable to access 'https://github.com/huihut/interview.git/': error:1407742E: SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version 的原因及解决方案。由于GitHub在2018年2月22日停止了对TLS1.0和1.1的支持,只支持TLS1.2,因此需要升级Git并配置TLS1.2来解决该问题。
1万+

被折叠的 条评论
为什么被折叠?



