Mvnw验证中出现SSLHandshakeException

omqzjyyz  于 2022-09-20  发布在  Maven
关注(0)|答案(1)|浏览(154)

我正在尝试构建pact-workshop-Maven-Springboot-JUnit5/tree/step1,但在运行命令“mvnw Verify”时收到以下错误:

C:UsersMyUsergitpact-workshop-Maven-Springboot-JUnit5consumer>mvnw verify
Found "C:UsersMyUsergitpact-workshop-Maven-Springboot-JUnit5consumer.mvnwrappermaven-wrapper.jar"
JRE being used (logged by my modification in mvnw.cmd): "C:Program Files (x86)Javajre7binjava.exe"
Takari Maven Wrapper 0.5.6
Downloading Maven binary from https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
Downloading https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip

Exception in thread "main" javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

    at sun.security.ssl.Alerts.getSSLException(Unknown Source)
    at sun.security.ssl.Alerts.getSSLException(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
    at org.apache.maven.wrapper.DefaultDownloader.downloadInternal(DefaultDownloader.java:90)
    at org.apache.maven.wrapper.DefaultDownloader.download(DefaultDownloader.java:76)
    at org.apache.maven.wrapper.Installer.createDist(Installer.java:72)
    at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:121)
    at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:61)

我已经将Maven Repo的证书添加到cacerts文件“C:\Program Files(X86)\Java\jre7\lib\Security\cacerts”。以下是它的条目(以ccerts表示):

C:WINDOWSsystem32>"C:Program Files (x86)Javajre7binkeytool.exe" -list -keystore "C:Program Files (x86)Javajre7libsecuritycacerts"
Enter keystore password:

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 79 entries

apachemaven, 14.Eyl.2022, trustedCertEntry,
Certificate fingerprint (SHA1): 5E:9A:A9:4B:5A:8A:1C:31:DB:1F:B5:E6:CF:E4:4D:B1:4C:AE:2F:5F

我遗漏了什么?

2admgd59

2admgd591#

Maven中央存储库仅支持TLS 1.2-more info

顺便说一句,前面提到的项目需要JDK 1.8,所以您必须至少使用JDK 1.8--而不是1.7。

使用JDK 1.8,您的问题将消失。

相关问题