然而,在配置或使用SSL连接时,开发者可能会遇到SSLException: Unrecognized SSL message, plaintext connection这一异常。 一、分析问题背景 SSLException: Unrecognized SSL message, plaintext connection通常发生在客户端和服务器之间进行通信时。 ); HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); conn.connect(); 二、可能出错的原因 导致SSLException 五、注意事项 在编写涉及SSL/TLS的网络通信代码时,注意以下事项可以有效避免SSLException: Unrecognized SSL message, plaintext connection异常 通过以上方法,您可以有效避免SSLException: Unrecognized SSL message, plaintext connection,并确保网络通信的安全性和稳定性。
5.4.2.3 SSLException必须适当处理,例如通知用户(必需) 在 HTTPS 通信中,当服务器证书无效或通信处于中间人攻击下时,SSLException会作为验证错误产生。 所以你必须为SSLException实现适当的异常处理。 通知用户通信失败,记录故障等,可被认为是异常处理的典型实现。 另一方面,在某些情况下可能不需要特别通知用户。 因为如何处理SSLException取决于应用规范和特性,你需要首先考虑彻底后再确定它。 如上所述,当SSLException产生时,应用可能受到中间人的攻击,所以它不能实现为,试图通过例如 HTTP 的非安全协议再次发送/接收敏感信息。
; nested exception is javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?" ; nested exception is javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?"
1、 用HttpClient发送Https请求报SSLException: Certificate for <域名> doesn't match any of the subject alternative 可以参考链接:https://stackoverflow.com/questions/39762760/javax-net-ssl-sslexception-certificate-doesnt-match-any-of-the-subject-alterna
为了简单地显示示例代码,不会执行针对SSLException的特殊处理。 根据应用规范,有必要正确处理异常。 另外,下面的示例代码允许使用 SSLv3 进行通信。 SSLException应该在应用中以适当的顺序处理。 为了简单地显示示例代码,不会执行针对SSLException的特殊处理。 根据应用规范,有必要正确处理异常。 要点: 使用私人证书机构的根证书来验证服务器证书。 URI 以https://开头。 SSLException应该在应用中以适当的顺序处理。 e) { // *** POINT 5 *** SSLException should be handled with an appropriate sequence in an
InterruptedIOException *
“SSLException” 此Java软件错误消息发生在与SSL相关的操作出现故障的时候。 以下示例来自Atlassian(@Atlassian): com.sun.jersey.api.client.ClientHandlerException: javax.net.ssl.SSLException _dispatch(DispatchProviderHelper.java:202) ...Caused by: javax.net.ssl.SSLException: java.lang.RuntimeException 阅读关于可能导致Java软件“SSLException”错误的讨论。(@StackOverflow) 45.
异常: EXCEPTION STACK TRACE: ** BEGIN NESTED EXCEPTION ** javax.net.ssl.SSLException MESSAGE: closing inbound before receiving peer’s close_notify STACKTRACE: javax.net.ssl.SSLException: closing inbound SSL 异常 javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify 这个异常通常表示: 客户端关闭了连接
Connection Time out"); return false; } if (e instanceof SSLException ) { logger.error("SSLException"); return false;
; import java.security.cert.X509Certificate; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLException throws IOException { } @Override public void verify(String host, X509Certificate cert) throws SSLException { } @Override public void verify(String host, String[] cns, String[] subjectAlts) throws SSLException
Auto-generated method stub } @Override public void verify(String arg0, X509Certificate arg1) throws SSLException Auto-generated method stub } @Override public void verify(String arg0, String[] arg1, String[] arg2) throws SSLException
但是邮件通知的时候出现错误: Unable to Send Mail - javax.net.ssl.SSLException: Unrecognized SSL message, plaintext
但是邮件通知的时候出现错误: Unable to Send Mail - javax.net.ssl.SSLException: Unrecognized SSL message, plaintext
升级更新nss之后即可解决: yum upgrade nss 错误如下: javax.NET.ssl.SSLException: Java.security.ProviderException: java.security.KeyException
WebMagic) https://github.com/code4craft/webmagic 于是就跟着文档学习,也遇到了坑…文档给出的版本是0.7.3,我使用的JDK版本是8,用它的例子跑的时候抛出了SSLException 异常(然而网上的0.6.x版本是没有问题的) 折腾完折腾去,也找到了0.7.3版本在JDK8上如何解决SSLException异常的办法了: http://www.cnblogs.com/vcmq/p/
NettyClient.java | 引入SSL认证 public class NettyClient { public static void main(String[] args) throws SSLException ).connect("127.0.0.1", 7398); } private void connect(String inetHost, int inetPort) throws SSLException NettyServer.java | 引入SSL安全验证 public class NettyServer { public static void main(String[] args) throws SSLException { new NettyServer().bing(7398); } private void bing(int port) throws SSLException {
; import java.security.cert.X509Certificate; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLException System.out.println(); System.out.println("No errors, certificate is already trusted"); } catch (SSLException
technologies/javase-jce8-downloads.html 下载之后将jar丢在{JAVA_HOME}/jre/lib/security 参考资料: 解决 JAVAX.NET.SSL.SSLEXCEPTION
跟进下后台的日志报错信息,找到如下三行关键栈日志: 1 2 3 4 5 6 7 java.lang.RuntimeException: java.lang.RuntimeException: javax.net.ssl.SSLException
Exception in thread "main" javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) Caused by: javax.net.ssl.SSLException