为什么Jenkins会因为SonarQube和GitLab插件的"PKIX路径构建失败“而失败?
我找到了这篇文章:https://support.cloudbees.com/hc/en-us/articles/217078498-PKIX-path-building-failed-error-message
然而,它似乎没有完全回答这个问题。
两条堆栈痕迹:
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和
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target发布于 2018-10-16 18:54:02
当配置Jenkins使用GitLab和SonarQube时,JVM需要知道服务器的密钥存储库和与外部站点签名以建立SSL连接的证书颁发机构(信任库)。
在CentOS服务器上,在/etc/sysconfig/jenkins中,向JENKINS_JAVA_OPTIONS属性添加以下内容:
JENKINS_JAVA_OPTIONS="-Djavax.net.ssl.trustStore=<path to trustStore in JKS format> -Djavax.net.ssl.trustStorePassword=<password> -Djavax.ssl.keyStore=<path to server keystore in JKS format> -Djavax.net.ssl.keyStorePassword=<password>"上面的内容与在Jenkins中设置HTTPS不同,可以使用以下两个属性来设置HTTPS:
JENKINS_HTTPS_KEYSTORE=<path to server keystore in JKS format>
JENKINS_HTTPS_KEYSTORE_PASSWORD=<password>
JENKINS_HTTPS_PORT=<port to listen on for https>注意:我一直回过头来看这篇CloudBees文章(https://support.cloudbees.com/hc/en-us/articles/217078498-PKIX-path-building-failed-error-message),它向后看了keyStore和trustStore,并没有说要同时设置它们。
https://stackoverflow.com/questions/52842214
复制相似问题