1.12.2开发环境搭建时证书问题

octopus


版本信息
Forge版本: <forge-1.12.2-14.23.5.2847-mdk>
Minecraft版本: <1.12.2>
Java版本: <1.8.0>

错误情况简述
在./gradlew setupDecompWorkspace后出现了类似AS没有依赖,没法compile时报的错误。
后来查到是Java在使用ssl时出现错误,但执行keytool -import -alias cacerts -keystore cacerts -file d:\software\CA.cer,敲入changeit后显示密钥错误,重装jdk依然显示错误。
报错信息

Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
        at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1946)
        at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:316)
        at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:310)
        at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1640)
        at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:223)
        at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1037)
        at sun.security.ssl.Handshaker.process_record(Handshaker.java:965)
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1064)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379)
        at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
        at sun.net.www.protocol.http.HttpURLConnection.followRedirect0(HttpURLConnection.java:2739)
        at sun.net.www.protocol.http.HttpURLConnection.followRedirect(HttpURLConnection.java:2651)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1830)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
        at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
        at org.gradle.wrapper.Download.download(Download.java:44)
        at org.gradle.wrapper.Install$1.call(Install.java:59)
        at org.gradle.wrapper.Install$1.call(Install.java:46)
        at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
        at org.gradle.wrapper.Install.createDist(Install.java:46)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:126)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:450)
        at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:317)
        at sun.security.validator.Validator.validate(Validator.java:262)
        at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:330)
        at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:227)
        at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:132)
        at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1622)
        ... 22 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
        at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
        at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
        at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:445)
        ... 28 more

查到的资料
https://blog.csdn.net/pzysoft/article/details/62888780
https://blog.csdn.net/tanyongbing1988/article/details/84423666?depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-1&utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-1
https://mkyong.com/webservices/jax-ws/suncertpathbuilderexception-unable-to-find-valid-certification-path-to-requested-target/


octopus


是我蠢了,不应该是jdk里面证书列表出问题,大概率单纯是我网络出了问题。
但问题又来了,我全程开着梯子,后来又用了代理,按理说不应该出现这样的问题。
希望大家能给个解决办法。


FledgeXu


论坛和mcbbs上都有离线包,你可以选择一个下载使用。
../t/topic/249/2


octopus


按照教程弄了一下又出现这个问题了
emmm这次好像还是依赖仓库出了问题

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'for'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT.
     Required by:
         :for:unspecified
      > Could not resolve net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT.
         > Unable to load Maven meta-data from https://files.minecraftforge.net/maven/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/maven-metadata.xml.
            > Could not GET 'https://files.minecraftforge.net/maven/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/maven-metadata.xml'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT.
         > Unable to load Maven meta-data from https://jcenter.bintray.com/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/maven-metadata.xml.
            > Could not GET 'https://jcenter.bintray.com/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/maven-metadata.xml'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED


FledgeXu


没有,这个还是网络问题……

  > Could not resolve net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT.
         > Unable to load Maven meta-data from https://files.minecraftforge.net/maven/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/maven-metadata.xml.
            > Could not GET 'https://files.minecraftforge.net/maven/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/maven-metadata.xml'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT.
         > Unable to load Maven meta-data from https://jcenter.bintray.com/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/maven-metadata.xml.
            > Could not GET 'https://jcenter.bintray.com/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/maven-metadata.xml'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

octopus


emmm
目前尝试过挂梯子和一些视频里的代理
挂梯子下了差不多一个上午,没一点动静
用了代理之后就是上面那个问题
不过我对代理原理不熟,就是按照视频里给的本地地址弄得,是不是那里出了问题


FledgeXu


你自己有代理吗?
如果没有代理,就不要挂代理。


octopus


你是指服务器代理吗?这个我没有


octopus


目前用的vpn是speeder。这些是都是有问题的吗?


FledgeXu


没有用过你说的东西,如果你对代理一窍不通请把代理部分的设置删了。


system


该主题在最后一个回复创建后7天后自动关闭。不再允许新的回复。