本文介绍了如何禁用javamail SSL支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在尝试发送电子邮件(使用Seam)时,我收到以下异常消息
I receive the following Exception while trying to send an email (using Seam)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find vali
d certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:285)
at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:191)
at sun.security.validator.Validator.validate(Validator.java:218)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:126)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:209)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:249)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1014)
... 68 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:174)
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:238)
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:280)
... 74 more
我使用一个没有额外设置的普通javamail应用程序测试了服务器,并且运行良好.
I tested the server by using a plain javamail app with no extra settings and it worked fine.
但是使用Seams邮件标签会发生异常.-有禁用SSL的方法吗?我真的不需要SSL.
But using Seams mail-tags the Exception occurs.- Is there a way to disable SSL?I realy don't need SSL.
我在论坛
mail.smtp.ssl.trust="*"
mail.smtp.starttls.enable="true"
- 我如何通过接缝框架将它们的上面的属性传递给javamail?
推荐答案
根据接缝参考手册和接缝论坛您应该能够直接在components.xml
配置中禁用TLS和SSL:
According to Seam reference manual and Seam forum you should be able to disable TLS and SSL directly in your components.xml
configuration:
<mail:mail-session debug="true" tls="false" ssl="false" ... />
这篇关于如何禁用javamail SSL支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!