JDK SSL无法正常工作 - trustAnchors参数必须为非空

时间:2018-06-01 09:17:29

标签: java spring ssl gradle ionic3

我尝试在ubuntu 18.04上构建一个Ionic应用程序,但它会出现此错误。

  

您已选择退出遥测。要更改此设置,请运行:cordova   遥测。 ANDROID_HOME = /根/的Android / SDK   JAVA_HOME = / usr / lib / jvm / java-8-oracle子项目路径:CordovaLib   下载   https://services.gradle.org/distributions/gradle-3.3-all.zip

     

线程中的异常" main" javax.net.ssl.SSLException:   java.lang.RuntimeException:意外错误:   java.security.InvalidAlgorithmParameterException:trustAnchors   参数必须是非空的   sun.security.ssl.Alerts.getSSLException(Alerts.java:208)at   sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1964)at at   sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1921)at at   sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1904)     在   sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1420)     在   sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)     在   sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)     在   sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)     在   sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)     在   sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)     在   sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)     在org.gradle.wrapper.Download.downloadInternal(Download.java:60)at   org.gradle.wrapper.Download.download(Download.java:45)at   org.gradle.wrapper.Install $ 1.call(Install.java:62)at   org.gradle.wrapper.Install $ 1.call(Install.java:48)at   org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)     在org.gradle.wrapper.Install.createDist(Install.java:48)at   org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)     在   org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)   引起:java.lang.RuntimeException:意外错误:   java.security.InvalidAlgorithmParameterException:trustAnchors   参数必须是非空的   sun.security.validator.PKIXValidator。(PKIXValidator.java:91)at   sun.security.validator.Validator.getInstance(Validator.java:179)at   sun.security.ssl.X509TrustManagerImpl.getValidator(X509TrustManagerImpl.java:312)     在   sun.security.ssl.X509TrustManagerImpl.checkTrustedInit(X509TrustManagerImpl.java:171)     在   sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:184)     在   sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)     在   sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1596)     在   sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)     在sun.security.ssl.Handshaker.processLoop(Handshaker.java:1052)at at   sun.security.ssl.Handshaker.process_record(Handshaker.java:987)at   sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1072)at at   sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)     在   sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)     ... 14更多引起:   java.security.InvalidAlgorithmParameterException:trustAnchors   参数必须是非空的   java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:200)     在java.security.cert.PKIXParameters。(PKIXParameters.java:120)     在   java.security.cert.PKIXBuilderParameters中。(PKIXBuilderParameters.java:104)     在sun.security.validator.PKIXValidator。(PKIXValidator.java:89)     ... 26更多(节点:23431)UnhandledPromiseRejectionWarning:错误:   / home / cruz / Documents / pro / platforms / android / gradlew:命令失败   退出代码1错误输出:线程中的异常" main"   javax.net.ssl.SSLException:java.lang.RuntimeException:意外   错误:java.security.InvalidAlgorithmParameterException :.   trustAnchors参数必须为非空   sun.security.ssl.Alerts.getSSLException(Alerts.java:208)at   sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1964)at at   sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1921)at at   sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1904)     在   sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1420)     在   sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)     在   sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)     在   sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)     在   sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)     在   sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)     在   sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)     在org.gradle.wrapper.Download.downloadInternal(Download.java:60)at   org.gradle.wrapper.Download.download(Download.java:45)at   org.gradle.wrapper.Install $ 1.call(Install.java:62)at   org.gradle.wrapper.Install $ 1.call(Install.java:48)at   org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)     在org.gradle.wrapper.Install.createDist(Install.java:48)at   org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)     在   org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)   引起:java.lang.RuntimeException:意外错误:   java.security.InvalidAlgorithmParameterException:trustAnchors   参数必须是非空的   sun.security.validator.PKIXValidator。(PKIXValidator.java:91)at   sun.security.validator.Validator.getInstance(Validator.java:179)at   sun.security.ssl.X509TrustManagerImpl.getValidator(X509TrustManagerImpl.java:312)     在   sun.security.ssl.X509TrustManagerImpl.checkTrustedInit(X509TrustManagerImpl.java:171)     在   sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:184)     在   sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)     在   sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1596)     在   sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)     在sun.security.ssl.Handshaker.processLoop(Handshaker.java:1052)at at   sun.security.ssl.Handshaker.process_record(Handshaker.java:987)at   sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1072)at at   sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)     在   sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)     ... 14更多引起:   java.security.InvalidAlgorithmParameterException:trustAnchors   参数必须是非空的   java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:200)     在java.security.cert.PKIXParameters。(PKIXParameters.java:120)     在   java.security.cert.PKIXBuilderParameters中。(PKIXBuilderParameters.java:104)     在sun.security.validator.PKIXValidator。(PKIXValidator.java:89)     ......还有26个       在ChildProcess.whenDone(/home/cruz/Documents/pro/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)       在emitTwo(events.js:126:13)       在ChildProcess.emit(events.js:214:7)       在maybeClose(internal / child_process.js:925:16)       在Process.ChildProcess._handle.onexit(internal / child_process.js:209:5)(node:23431)   UnhandledPromiseRejectionWarning:未处理的承诺拒绝。这个   错误源于抛出异步函数   没有陷阱,或拒绝未处理的承诺   用.catch()。 (拒绝id:1)(节点:23431)[DEP0018]   弃用警告:已弃用未处理的承诺拒绝。在   未来,未经处理的承诺拒绝将终止   Node.js使用非零退出代码进行处理。

我尝试重新安装证书,但仍未修复。请帮助我!

0 个答案:

没有答案