java - Openshift 部署 F8 : Cannot access cluster for detecting mode: sun. security.validator.ValidatorException

标签 java kubernetes ssl-certificate openshift fabric8

我正在使用fabric8 maven部署部署示例springboot应用程序。构建失败并出现 SSLHandshakeException。

F8: Cannot access cluster for detecting mode: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Failed to execute goal io.fabric8:fabric8-maven-plugin:3.1.80.redhat-000010:build (default) on project fuse-camel-sb-rest: Execution default of goal io.fabric8:fabric8-maven-plugin:3.1.80.redhat-000010:build failed: An error has occurred. sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.fabric8:fabric8-maven-plugin:3.1.80.redhat-000010:build (default) on project fuse-camel-sb-rest: Execution default of goal io.fabric8:fabric8-maven-plugin:3.1.80.redhat-000010:build failed: An error has occurred.

因此,我从 Openshift Webconsole 下载了公共(public)证书,并使用

将其添加到 JVM
C:\...\jdk.\bin>keytool -import -alias rootcert -file C:\sample\RootCert.cer -keystore cacerts

并收到消息,表明已成功添加到 keystore ,并且列表命令显示已添加的证书。

    C:\...\jdk.\bin>keytool -list -keystore cacerts
Enter keystore password:
Keystore type: JKS
Keystore provider: SUN

Your keystore contains 2 entries

rootcert, May 18, 2018, trustedCertEntry,
Certificate fingerprint (SHA1): XX:XX:XX:..........

但是 mvn:fabric8 部署构建仍然失败,并出现相同的异常。

有人可以解释一下这个问题吗?我错过了什么吗?

最佳答案

将证书添加到 $JAVAHOME/jre/lib/security 中的“cacerts”中解决了该问题。

关于java - Openshift 部署 F8 : Cannot access cluster for detecting mode: sun. security.validator.ValidatorException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50412251/

相关文章:

java - 在 Java 中解码 Mail.app 电子邮件附件文件名

java - RabbitMQ - 我如何捕获 ForgivingExceptionHandler?

kubernetes - Kubectl get nodes return "the server doesn' t have a resource type "nodes""

Kubernetes 入口 Controller 找不到 TLS 证书 key

kubernetes - Initcontainer 与 Helm Hook 安装后

objective-c - sendSynchronousRequest 使用安装在 Mac OS X keychain for Mac 上的自签名证书

python - SSL : WRONG_VERSION_NUMBER ON PYTHON REQUEST

java - 如果我在 XML 布局中声明一个 fragment ,我如何将它传递给 Bundle?

java - Android 中的 iText 合并 pdf 错误,使用最新的库

java - HttpClient 4.1 出现 SSL "Peer Not Authenticated"错误