简体   繁体   English

无法将套接字转换为Apache Commons Mail上的TLS

[英]Could not convert socket to TLS on Apache Commons Mail

I have a problem connecting to a SMTP Server with Apache Commons Mail. 我用Apache Commons Mail连接到SMTP服务器时遇到问题。 I have tried everything but the only thing I can find online is for Java Mail. 我已经尝试了所有方法,但是只能在网上找到Java Mail。 This is my error: 这是我的错误:

Caused by: javax.mail.MessagingException: Could not convert socket to TLS; 原因:javax.mail.MessagingException:无法将套接字转换为TLS;无法将套接字转换为TLS。 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 嵌套的异常是:javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到到请求目标的有效证书路径

I have seen that you can fix the issue on Java Mail with props.put("mail.smtp.ssl.trust", "smtp.gmail.com"); 我已经看到您可以使用props.put("mail.smtp.ssl.trust", "smtp.gmail.com");来解决Java Mail上的问题props.put("mail.smtp.ssl.trust", "smtp.gmail.com"); for example, but I can't a equivalent command to use on Apache Commons. 例如,但是我不能在Apache Commons上使用等效命令。

If you're really connecting to Gmail, you shouldn't need that. 如果您确实要连接到Gmail,则不需要。 The Gmail certificate will be trusted by the default trust store. 默认的信任库将信任Gmail证书。 If you've configured a non-default trust store, add the Gmail certificate to that trust store using the InstallCert program. 如果您配置了非默认信任库,请使用InstallCert程序将Gmail证书添加到该信任库。

暂无
暂无

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

相关问题 无法发送邮件:无法将套接字转换为TLS。 - Unable to send mail: Could not convert socket to TLS; 通过Java程序发送邮件(无法将套接字转换为TLS错误) - Sending Mail through Java program(Could not convert socket to TLS error) javax.mail.MessagingException:无法在 JAVA 中将套接字转换为 TLS 异常 - javax.mail.MessagingException: Could not convert socket to TLS exception in JAVA javax.mail.MessagingException:无法将套接字转换为TLS - javax.mail.MessagingException: Could not convert socket to TLS 无法使用 SMTP 发送 email(获取 javax.mail.MessagingException:无法将套接字转换为 TLS;) - Unable to send an email using SMTP (Getting javax.mail.MessagingException: Could not convert socket to TLS;) 通过 SMTP 发送邮件时出现“MessagingException:无法将套接字转换为 TLS” - Getting “MessagingException: Could not convert socket to TLS” when sending mail via SMTP 如何解决“邮件服务器连接失败; 嵌套的异常是javax.mail.MessagingException:无法将套接字转换为TLS;无法将套接字转换为TLS。 使用Spring-mvc? - How to fix “Mail server connection failed; nested exception is javax.mail.MessagingException: Could not convert socket to TLS; ” using Spring-mvc? Javamail 无法将套接字转换为 TLS GMail - Javamail Could not convert socket to TLS GMail Java 邮件逻辑:无法将套接字转换为 TLS - Java Mailing Logic: Could not convert socket to TLS 如何修复Java中的“无法将套接字转换为TLS”错误 - How to fix 'Could not convert socket to TLS' error in java
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM