[英]Exception while connecting to mail server
I got the following exception while connecting to Mail server from IBM WAS. 从IBM WAS连接到邮件服务器时,出现以下异常。
javax.mail.MessagingException: Could not convert socket to TLS; nested exception is: java.net.SocketException: java.security.PrivilegedActionException: java.io.FileNotFoundException: D:\Program Files (x86)\IBM\WebSphere\AppServer\jre\lib\security\cacerts (The system cannot find the path specified.)
My question is: 我的问题是:
What is the certificate that I should import? 我应该导入什么证书? Is it the mail server's certificate which needs to be imported into WAS?
是否需要将邮件服务器的证书导入WAS? Should I ask the mail server admin to share the certificate?
我是否应该请邮件服务器管理员共享证书?
Once I figure out which certificate, I plan to follow these instructions to import it: How to connect to a secure website using SSL in Java with a pkcs12 file? 确定了哪个证书后,我打算按照以下说明进行导入: 如何使用Java中的SSL和pkcs12文件使用SSL连接到安全网站?
That link is not the correct way to use mail sessions in WAS. 该链接不是在WAS中使用邮件会话的正确方法。 Check this Websphere 7 javax.mail.MessagingException: SSLSocketFactory is null .
检查此Websphere 7 javax.mail.MessagingException:SSLSocketFactory为null 。
Try to use default SSL WebSphere configuration and Mail session resource. 尝试使用默认的SSL WebSphere配置和邮件会话资源。 You will need to add your mail server certificate to the Trust store (
NodeDeaultTrustStore
or CellDefaultTrustStore
depending whether you use standalone or network deployment version). 您将需要将邮件服务器证书添加到信任存储(
NodeDeaultTrustStore
或CellDefaultTrustStore
具体取决于您使用的是独立版本还是网络部署版本)。
It should be possible to get mail server cert using a browser, when you connect using https://mailserver:port
/ it should give you certificate which you could save locally and add to truststore. 当您使用
https://mailserver:port
/连接时,应该可以使用浏览器获取邮件服务器证书,它应该为您提供可以在本地保存并添加到信任库的证书。 If you will have problems contact mail server admin. 如果您有问题,请联系邮件服务器管理员。
PrivilegedActionException
also suggest that you may have Java 2 security
enabled. PrivilegedActionException
也建议您启用Java 2 security
。 Check if it is enabled and if you really need it. 检查是否已启用它,以及是否确实需要它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.