Java Springboot javax.net.ssl.SSLException: Connection reset解决方案
接口设置HTTPS TLS1.2后,随机出现SSLException: Connection reset报错:
javax.net.ssl.SSLException: Connection reset
at sun.security.ssl.Alert.createSSLException(Alert.java:127) ~[na:1.8.0_312]
at sun.security.ssl.TransportContext.fatal(TransportContext.java:324) ~[na:1.8.0_312]
at sun.security.ssl.TransportContext.fatal(TransportContext.java:267) ~[na:1.8.0_312]
at sun.security.ssl.TransportContext.fatal(TransportContext.java:262) ~[na:1.8.0_312]
at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1563) ~[na:1.8.0_312]
at sun.security.ssl.SSLSocketImpl.access$400(SSLSocketImpl.java:73) ~[na:1.8.0_312]
at sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:973) ~[na:1.8.0_312]
at org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:137) ~[da-qa-1.0-SNAPSHOT.jar:na]
at org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:153) ~[da-qa-1.0-SNAPSHOT.jar:na]
at org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:280) ~[da-qa-1.0-SNAPSHOT.jar:na]
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138) ~[da-qa-1.0-SNAPSHOT.jar:na]
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56) ~[da-qa-1.0-SNAPSHOT.jar:na]
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259) ~[da-qa-1.0-SNAPSHOT.jar:na]
at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163) ~[da-qa-1.0-SNAPSHOT.jar:na]
at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:157) ~[da-qa-1.0-SNAPSHOT.jar:na]
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273) ~[da-qa-1.0-SNAPSHOT.jar:na]
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125) ~[da-qa-1.0-SNAPSHOT.jar:na]
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272) ~[da-qa-1.0-SNAPSHOT.jar:na]
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186) ~[da-qa-1.0-SNAPSHOT.jar:na]
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) ~[da-qa-1.0-SNAPSHOT.jar:na]
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) ~[da-qa-1.0-SNAPSHOT.jar:na]
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) ~[da-qa-1.0-SNAPSHOT.jar:na]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) ~[da-qa-1.0-SNAPSHOT.jar:na]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108) ~[da-qa-1.0-SNAPSHOT.jar:na]
at com.cooladata.da.TrackTask.sendTrack(TrackTask.java:62) [da-qa-1.0-SNAPSHOT.jar:na]
at com.cooladata.da.TrackTask.startListening(TrackTask.java:108) [da-qa-1.0-SNAPSHOT.jar:na]
at com.cooladata.da.TrackTask.run(TrackTask.java:120) [da-qa-1.0-SNAPSHOT.jar:na]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_312]
Suppressed: java.net.SocketException: Broken pipe (Write failed)
at java.net.SocketOutputStream.socketWrite0(Native Method) ~[na:1.8.0_312]
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111) ~[na:1.8.0_312]
at java.net.SocketOutputStream.write(SocketOutputStream.java:155) ~[na:1.8.0_312]
at sun.security.ssl.SSLSocketOutputRecord.encodeAlert(SSLSocketOutputRecord.java:81) ~[na:1.8.0_312]
at sun.security.ssl.TransportContext.fatal(TransportContext.java:355) ~[na:1.8.0_312]
... 26 common frames omitted
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:210) ~[na:1.8.0_312]
at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[na:1.8.0_312]
at sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:464) ~[na:1.8.0_312]
at sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocketInputRecord.java:68) ~[na:1.8.0_312]
at sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java:1341) ~[na:1.8.0_312]
at sun.security.ssl.SSLSocketImpl.access$300(SSLSocketImpl.java:73) ~[na:1.8.0_312]
at sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:957) ~[na:1.8.0_312]
... 21 common frames omitted
httpclinets设置成 .setConnectionReuseStrategy(NoConnectionReuseStrategy.INSTANCE)
httpClient = HttpClients.custom().setDefaultRequestConfig(config)
.setConnectionReuseStrategy(NoConnectionReuseStrategy.INSTANCE)
.setConnectionManager(poolingConnManager)
.build();
Java Springboot javax.net.ssl.SSLException: Connection reset解决方案的更多相关文章
- presto——java.sql.SQLException: Error executing query与javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?异常问题
使用presto的时候以mysql为presto的数据源 安装的presto是0.95版本:使用的presto-jdbc是0.202的,这里使用jdbc去访问时候,connection可以链接成功,但 ...
- javax.net.ssl.SSLException: java.lang.UnsupportedOperationException
Loading KeyStore C:\Tool\jdk1.7.0_71\jre\lib\security\jssecacerts... Opening connection to www.googl ...
- 微信证书 javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
这几天在做微信退款接口,按照api写完之后,在本地测试了下没有问题,于是交给测试让他们在测试环境开测.他们说退款没有成功,感觉去查日志,发现后台报了 javax.net.ssl.SSLExceptio ...
- JAVA连接MySQ报错:Caused by: javax.net.ssl.SSLException: Received fatal alert: protocol_version
Caused by: javax.net.ssl.SSLException: Received fatal alert: protocol_version at sun.security.ssl.Al ...
- SO2O連接報錯javax.net.ssl.SSLException: Received fatal alert: protocol_version)
原文:https://blog.csdn.net/gudejundd/article/details/89640741 1.什么是TLSSSL 是“Secure Sockets Layer”的缩写,中 ...
- java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
- javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection
客户端向服务器发送数据时,份两种情况,SSL单向验证和SSL双向验证 1.SSL单向验证时 代码如下: import java.io.IOException; import java.util.Has ...
- 高并发下载tomcat下的文件时,发生java.net.SocketException: Connection reset解决方案
(1)问题产生:使用500个线程并发下载tomcat工程中的一个文件时,服务器出现java.net.SocketException: Connection reset异常, 客户端出现connect ...
- 解决 javax.net.ssl.SSLException: java.lang.RuntimeException: Could not generate DH keypair
解决这个异常的重点就在于下载两个jar包: bcprov-ext-jdk15on-1.52 bcprov-jdk15on-1.52 传送门:https://stackoverflow.com/ques ...
- javax.net.ssl.SSLException: Certificate doesn't match any of the subject alternative names
问题:在使用 org.apache.http.*下的 CloseableHttpClient 发送https请求时报了以上错误 解决方案一:使用java.net.HttpURLConnection i ...
随机推荐
- C# - 将HTML网页、HTML字符串转换为PDF
将HTML转换为PDF可实现格式保留.可靠打印.文档归档等多种用途,满足不同领域和情境下的需求.本文将通过以下两个示例,演示如何使用第三方库Spire.PDF for .NET和QT插件在C# 中将H ...
- vue实现简易瀑布流
实现效果 1.不同屏幕尺寸下根据可视区域宽度判断 应该 放几列,这里用onresize演示 2.鼠标滚动到已加载数据的底部时再次请求数据,重新计算哪一列高度最小,push到最小的那一列 实现思路 1. ...
- SpringBoot自动化配置
SpringBoot自动化配置 一.SpringBoot自动化配置原理 1.SpringBoot引导类注解介绍 在SpringBoot的启动引导类上有一个@SpringBootApplication注 ...
- Matter开发,看这一篇就够了
1. Matter介绍 Matter(以前称为 Project Connected Home over IP 或 Project CHIP)是由CSA联盟制定的一个应用层面的标准,旨在打造一个统一的智 ...
- NC50493 石子合并
题目链接 题目 题目描述 将n堆石子绕圆形操场排放,现要将石子有序地合并成一堆.规定每次只能选相邻的两堆合并成新的一堆,并将新的一堆的石子数记做该次合并的得分. 请编写一个程序,读入堆数n及每堆的石子 ...
- Android上的日志
Android的日志机制和普通的Java项目有一些不一样, 这里记录一下 安卓内建的Log 安卓应用类型(在build.gradle里定义 android {...})的模块, 可以直接引用内建的an ...
- Java使用正则表达式判断字符串中是否包含某子字符串
需求: 给定一个字符串s,判断当s中包含"tree fiddy"或"3.50"或"three thirty"子字符串返回true,否则返回f ...
- MySQL写入SQL整个执行流程
innodb存储引擎中一条sql写入的详细流程 第0步:会先去看缓冲区有没有这条数据,如果有就不进行缓存,直接进入第三步. 第1步:会将要修改的那一行数据所在的一整页加载到缓冲池Buffe ...
- EXPLAIN命令
EXPLAIN命令 除了以SELECT开头的查询语句,其余的DELETE.INSERT.REPLACE以及UPDATE语句前边都可以加上EXPLAIN这个词儿,用来查看这些语句的执行计划 Ty ...
- win32 - Redirect Input and Output
如果要将exe的输出重定向到cmd,则可以使用匿名管道将子进程的标准输入和输出句柄重定向.请注意,命名管道也可以用于重定向进程I / O //CMD.exe #include <windows. ...