2017-04-04 66 views
0

我想注册后发送电子邮件通知时转换连接到SSL:无法,我根据有关配置电子邮件jhipster文档万物发送电子邮件jhipster

mail: 
    host: smtp.gmail.com 
    port: 587 
    username: *******@gmail.com 
    password: ***** 
    protocol: smtp 
    tls: true 
    properties.mail.smtp: 
     auth: true 
     starttls.enable: true 
     ssl.trust: smtp.gmail.com 

根据计算器上我允许谷歌帐户的另一个问题与安全性较低的应用程序连接,但尽管如此,我得到异常:

org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Unable to convert connection to SSL (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). Failed messages: javax.mail.MessagingException: Unable to convert connection to SSL (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) 

我应该怎么做来解决这个问题?

预先感谢您。

回答

1

也许你从没有SSL证书的服务器发送电子邮件?

+0

是的,我没有证书。如何生成它? – Ice

+1

既然你使用JHipster,我建议你看看下面的链接:https://stackoverflow.com/questions/29522114/how-to-add-self-signed-ssl-certificate-to-jhipster-sample-app –

+1

另外:https://jhipster.github.io/tips/007_tips_enforce_https.html –