为什么我收到“收到致命警报:协议版本"?或“未认证的对等方"从 Maven 中心? [英] Why am I getting "Received fatal alert: protocol_version" or "peer not authenticated" from Maven Central?
问题描述
我在连接到 Maven Central/https://repo1.maven.org 时遇到以下错误2018 年 6 月 18 日之后.
I'm getting the below errors when connecting to Maven Central / https://repo1.maven.org after June 18th 2018.
Received fatal alert: protocol_version
或
Received fatal alert: peer not authenticated
推荐答案
方案一:配置Java 7
需要在命令行中启用带有Java属性的TLS 1.2协议
It is need to enable TLS 1.2 protocol with Java property in the command line
mvn -Dhttps.protocols=TLSv1.2 install
install
只是一个目标的例子
ant
同样的错误可以这样解决
The same error for ant
can be solved by this way
java -Dhttps.protocols=TLSv1.2 -cp %ANT_HOME%/lib/ant-launcher.jar org.apache.tools.ant.launch.Launcher
解决方案 2:使用带有 Oracle 高级支持的 Java 7
也可以通过更新 Java 7 版本来解决问题.但是最后一个可用版本 (7u80
) 并没有解决这个问题.需要使用 Oracle Advanced Support(以前称为 Java for Business)提供的更新.
Also problem can be solved by updating the Java 7 version. But the last available version (7u80
) doesn't fix the problem. It is need to use an update provided with Oracle Advanced Support (formerly known as Java for Business).
解决方案 3:改用 Java 8
将 $JAVA_HOME
配置为指向 Java 8.
Configure $JAVA_HOME
to point to Java 8.
这篇关于为什么我收到“收到致命警报:协议版本"?或“未认证的对等方"从 Maven 中心?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!