admin管理员组文章数量:1567012
java发送邮件时报以下错误信息:
javax.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher
Exception in thread "main" javax.mail.MessagingException: Could not connect to SMTP host: smtp.suixingpay, port: 465;
nested exception is:
javax.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2055)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:697)
at javax.mail.Service.connect(Service.java:364)
at javax.mail.Service.connect(Service.java:245)
错误原因:
jdk版本问题
笔者使用的jdk版本为1.8.0_301
/Library/Java/JavaVirtualMachines/jdk1.8.0_301.jdk/Contents/Home/jre/lib/security/java.security
java.security文件内容
jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \
DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
include jdk.disabled.namedCurves
解决办法
办法一:删除掉java.security文件中的SSLv3, TLSv1, TLSv1.1
办法二:更换jdk版本
本文标签: 发邮件错误javaxJavaSSLHandshakeException
版权声明:本文标题:解决java发邮件错误javax.net.ssl.SSLHandshakeException: No appropriate protocol 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dongtai/1726296426a1064666.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论