簡介
本文檔介紹如何將CloudCenter證書匯入Jenkins java金鑰庫。
作者:Deepak Sukhiya,思科TAC工程師。
應用程式版本
CloudCenter管理員 |
4.0/4.2.x/4.4.x/4.5.x/4.6.x/4.7.x/4.8.0 |
問題
如何將CloudCenter證書匯入Jenkins java金鑰庫
或
從Project > Configure選單驗證連線失敗,在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 example -keystore <替換java路徑的路徑>/jre/lib/security/cacerts -file <儲存的證書檔案的位置>。
- CloudCenter的身份驗證將正確驗證。