Java Coldfusion在一段时间后停止使用smtp.gmail.com发送电子邮件

Java Coldfusion在一段时间后停止使用smtp.gmail.com发送电子邮件,java,coldfusion,smtp,gmail,Java,Coldfusion,Smtp,Gmail,我使用smtp.gmail.com:465作为coldfusion的邮件服务器。我使用命令opensslsu client-connectsmtp.gmail.com:465获取证书并将其导入Java信任库 它可以完美地工作一段时间,没有任何问题。然后,在随机数周后,它停止工作,并给出以下错误: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465; nested exce

我使用smtp.gmail.com:465作为coldfusion的邮件服务器。我使用命令
opensslsu client-connectsmtp.gmail.com:465
获取证书并将其导入Java信任库

它可以完美地工作一段时间,没有任何问题。然后,在随机数周后,它停止工作,并给出以下错误:

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
它在抓取证书并再次导入后工作

我不得不一直这样做,这让人很恼火


有人知道问题的原因吗?如果可能的话,还有解决方案吗?

经过一番挖掘,我意识到java信任库(cacert)丢失了所有根CA证书,包括gmail的根CA。a找到了包括gmail在内的常见根CA证书列表,并将它们导入信任库