在詹金斯中配置电子邮件的问题

时间:2018-09-17 19:09:55

标签: jenkins

我试图遍历堆栈溢出所提供的所有解决方案,例如添加跳过插件或在密钥库中添加证书,仍然测试电子邮件是否失败并出现以下错误,有人可以帮助我吗?我正在使用Windows计算机

Error in jenkins:sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
    at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
    at java.security.cert.CertPathBuilder.build(Unknown Source)
Caused: sun.security.validator.ValidatorException: PKIX path building failed
    at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
    at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
    <snip>
Caused: javax.net.ssl.SSLHandshakeException
    at sun.security.ssl.Alerts.getSSLException(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
    <snip>
Caused: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
  nested exception is:
    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 com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1934)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)
    at javax.mail.Service.connect(Service.java:317)
    at javax.mail.Service.connect(Service.java:176)
    at javax.mail.Service.connect(Service.java:125)
    at javax.mail.Transport.send0(Transport.java:194)
    at javax.mail.Transport.send(Transport.java:124)
    at hudson.tasks.Mailer$DescriptorImpl.doSendTestMail(Mailer.java:585)
    <snip>

cmd提示说,证书库中的别名下已经存在证书。

1 个答案:

答案 0 :(得分:1)

转到https://<jenkins-url>/systemInfo并查找javax.net.ssl.trustStore。 这应该是应该在其中添加证书的信任库。

您可以使用keytool打开密钥库,或者如果您更喜欢GUI,请查看Keystore Explorer

信任库的默认密码为changeit