解决jdk1.8发送邮件SSL握手失败问题

来源:互联网 发布:周杰伦中文网淘宝店 编辑:程序博客网 时间:2024/04/27 17:01

  今天在写一个邮件发送Demo的时候,出现了下面的问题

发送邮件失败Mail server connection failed; nested exception is javax.mail.MessagingException: Could not connect to SMTP host: smtp.qq.com, port: 465;

nested exception is: javax.NET.ssl.SSLHandshakeException: Received fatal alert: handshake_failure. Failed messages: javax.mail. MessagingException: Could not connect to SMTP host: smtp.qq.com, port: 465;

nested exception is: javax.Net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

花了一个下午在网上查资料发现是jdk1.8的安全验证有问题,只需要去官网下载相关jar换掉即可

这两个jar包的下载地址:http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html。

Ok  大功告成。

0 0
原创粉丝点击