简体   繁体   English

GlassFish 4和Java Mail:PKIX路径构建失败

[英]GlassFish 4 and Java Mail: PKIX path building failed

i tried this tutorial ( http://czetsuya-tech.blogspot.de/2012/11/how-to-send-email-in-glassfish-using.html ). 我尝试了本教程( http://czetsuya-tech.blogspot.de/2012/11/how-to-send-email-in-glassfish-using.html )。 I am using GlassFish 4 on Windows 7 Professional 64-bit. 我在Windows 7 Professional 64位上使用GlassFish 4。

Is this tutorial working because i got this exception: 本教程是否正常工作,因为我遇到了以下例外情况:

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

Have you tampered / modified $JAVA_HOME/jre/lib/security/cacerts file? 您是否篡改过/修改了$ JAVA_HOME / jre / lib / security / cacerts文件? If so try re-installing jdk. 如果是这样,请尝试重新安装jdk。 That keystore is normally where the trust certificate came from, and google's trust certificate should be accepted by default. 该密钥库通常是信任证书的来源,默认情况下应接受google的信任证书。

Beware also of other JVM env var that might discard standard certificates. 还请注意其他可能会丢弃标准证书的JVM环境变量。 (eg: -Djavax.net.ssl.trustStore) (例如:-Djavax.net.ssl.trustStore)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM