为什么我会收到“收到的致命警报:protocol_version"消息?或“对等方未通过身份验证"从Maven Central? [英] 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
推荐答案
解决方案1:配置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
仅仅是目标的一个例子
install
is just an example of a goal
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:将Java 7与Oracle Advanced Support一起使用
也可以通过更新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.
这篇关于为什么我会收到“收到的致命警报:protocol_version"消息?或“对等方未通过身份验证"从Maven Central?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!