简介
本文档介绍如何将CloudCenter证书导入Jenkins Java密钥库。
作者:Deepak Sukhiya,思科TAC工程师。
应用程序版本
CloudCenter Manager |
4.0 / 4.2.x /4.4.x /4.5.x / 4.6.x/ 4.7.x / 4.8.0 |
问题
如何将CloudCenter证书导入Jenkins Java密钥库
或
从“项目”>“配置”菜单验证连接失败,在jenkins日志中出现以下错误:
Building in workspace /var/lib/jenkins/workspace/C3-Cent7
ERROR: Build step failed with exception
javax.ws.rs.ProcessingException: 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 org.glassfish.jersey.client.HttpUrlConnector.apply(HttpUrlConnector.java:229)
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:224)
at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:656)
at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:653)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:424)
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:653)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:388)
at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:292)
at cliqr.jenkins.plugin.CliQrJenkinsClient.RestUtils.getAppDetails(RestUtils.java:156)
at cliqr.jenkins.plugin.CliQrJenkinsClient.CliQrJenkinsClientBuilder.perform(CliQrJenkinsClientBuilder.java:243)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.Build$BuildExecution.build(Build.java:205)
at hudson.model.Build$BuildExecution.doRun(Build.java:162)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1728)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Caused by: 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)
解决方案
- 通过Firefox登录CloudCenter Manager(CCM)计算机。
- 使用浏览器上的挂锁图标查看CloudCenter证书并保存。
- 将保存的证书复制到Jenkins计算机。
- 通过安全外壳(SSH)登录Jenkins计算机。
- 在Jenkins计算机上运行以下命令:
keytool -import -trustcacerts -alias示例 — keystore <替换java路径>/jre/lib/security/cacerts -file <保存的证书文件的位置>。
- CloudCenter的身份验证将正确验证。