在Windows使用Git客户端访问github,执行pull或push时,报不能访问SSL相关的错误:
fatal: unable to access 'https://github.com/xxxx/xxx.git/': error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
在网上查找了一下原因,这个应该是和Github最近移除弱密码标准工作相关。参考:https://githubengineering.com/crypto-removal-notice/,通告移除的协议内容如下:
- TLSv1/TLSv1.1: This applies to all HTTPS connections, including web, API, and git connections to https://github.com and https://api.github.com.
- diffie-hellman-group1-sha1: This applies to all SSH connections to github.com
- diffie-hellman-group14-sha1: This applies to all SSH connections to github.com
以下客户端会不兼容:
- Git-Credential-Manager-for-Windows < v1.14.0
- Git on Red Hat 5, < 6.8, and < 7.2
- Java releases < JDK 8
- Visual Studio:最新版已经兼容
解决方法
升级git到最新版本,目前最新版本为2.16.2。下载地址:https://git-scm.com/download/win