java javax.net.ssl.SSLException - trustAnchors 参数必须非空

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47921563/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 09:52:26  来源:igfitidea点击:

javax.net.ssl.SSLException - the trustAnchors parameter must be non-empty

javagradleopensslopenssl-engine

提问by Gavriil

When I try to run ./gradlew runI keep getting:

当我尝试跑步时,./gradlew run我不断收到:

Downloading https://services.gradle.org/distributions/gradle-4.4.1-bin.zip

Exception in thread "main" javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

Tried curl -v https://services.gradle.org/distributions/gradle-4.4.1-bin.zipand works just fine

尝试过curl -v https://services.gradle.org/distributions/gradle-4.4.1-bin.zip,效果很好

Connected to services.gradle.org (2400:cb00:2048:1::6810:aba6)
successfully set certificate verify locations:
CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs

采纳答案by Spangen

You haven't mentioned which JDK or OS/distro you are using, but it's possible that ca-certificates-javais not a dependency in the Oracle JDK/JRE so this must be explicitly installed.

您没有提到您使用的是哪个 JDK 或 OS/发行版,但它可能ca-certificates-java不是 Oracle JDK/JRE 中的依赖项,因此必须明确安装。

You might need to run

你可能需要运行

sudo /var/lib/dpkg/info/ca-certificates-java.postinst configure

See also Error - trustAnchors parameter must be non-empty

另请参阅 错误 - trustAnchors 参数必须为非空