Reputation: 35
hi guys i have problem for hit endpoint use ssl
why on java 11 randomly give sslexception when we hit endpoint https ?
error javax.net.ssl.SSLException: Connection reset
how to fix this issue ? i have try add some code like this
System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2");
but still getting the issue
Upvotes: 0
Views: 804
Reputation: 123531
TL;DR: there is no single thing which can fix this error. If it can be fixed and how depends on the (missing) details.
This error means that the server closed the connection. If this error occurs only from time to time with the same server there is nothing you can do except accepting that the server sometimes behaves this way, i.e. catch the error and treat the connection as failed. Such problems can happen for a variety of reasons, like temporary malfunction of the server or server-side rejecting connections due to server overload.
If it happens systematically with specific servers on has to debug this specific problem - there might be ways to fix it by adjusting how the client communicates with the server or there might be not. More details are needed to find out.
Upvotes: 2