15

I am getting ERROR:

java.net.SocketException: Connection reset.

I have followed the below link to resolve the issue. But no luck..

I have given the error logs below. Can any one look this and let me know how to resolve this issue?

Thu Mar 23 16:11:51 IST 2017:ERROR:java.net.SocketException: Connection reset
   java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at sun.security.ssl.InputRecord.readFully(Unknown Source)
    at sun.security.ssl.InputRecord.read(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source)
    at sun.security.ssl.AppOutputStream.write(Unknown Source)
    at org.apache.http.impl.io.AbstractSessionOutputBuffer.flushBuffer(AbstractSessionOutputBuffer.java:131)
    at org.apache.http.impl.io.AbstractSessionOutputBuffer.flush(AbstractSessionOutputBuffer.java:138)
    at org.apache.http.impl.conn.LoggingSessionOutputBuffer.flush(LoggingSessionOutputBuffer.java:95)
    at org.apache.http.impl.AbstractHttpClientConnection.doFlush(AbstractHttpClientConnection.java:270)
    at org.apache.http.impl.AbstractHttpClientConnection.flush(AbstractHttpClientConnection.java:275)
    at org.apache.http.impl.conn.AbstractClientConnAdapter.flush(AbstractClientConnAdapter.java:197)
    at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:258)
    at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$SoapUIHttpRequestExecutor.doSendRequest(HttpClientSupport.java:113)
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
    at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:633)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
    at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$Helper.execute(HttpClientSupport.java:247)
    at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport.execute(HttpClientSupport.java:362)
    at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.submitRequest(HttpClientRequestTransport.java:324)
    at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:237)
    at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:127)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Cœur
  • 37,241
  • 25
  • 195
  • 267
ChanGan
  • 4,254
  • 11
  • 74
  • 135
  • Is that your client side exception? What does the server say ? – Brian Agnew Mar 23 '17 at 13:05
  • The same is working fine in browser. but when call from Soapui i am getting the error. – ChanGan Mar 23 '17 at 13:10
  • 1
    Please run your client with `-Djavax.net.debug=ssl,handshake` and post the result in your question. If your server is doing client authentication please also supply the relevant client-side settings. – user207421 Mar 27 '17 at 05:16

6 Answers6

22

WINDOWS

Option 1:

  1. find the following file on your computer (make sure you have write access to the file): C:\Program Files\SmartBear\SoapUI-5.2.1\bin\SoapUI-5.2.1.vmoptions

  2. Add the following line to the file:

-Dsoapui.https.protocols="SSLv3,TLSv1.2"

  1. Run SoapUI with the .exe file (SoapUI-5.2.1.exe)

Option 2: (if option 1 does not work for you).

  1. Edit the following batch file on your computer (make sure you have write access to the file): C:\Program Files\SmartBear\SoapUI-5.2.1\bin\soapui.bat
  2. Add the following line to the file (after: if "%SOAPUI_HOME%" == "" goto START):

set JAVA_OPTS=%JAVA_OPTS% -Dsoapui.https.protocols="SSLv3,TLSv1.2"

  1. Run SoapUI with the batch file (soapui.bat)

MAC (OSX)

The default install location for Mac is in the root Applications folder, and the vmoptions.txt file is in there. Right-click the SOAPUI .app file (in the /Applications folder), and choose "Show Package Contents" to get to the internal files.

/Applications/SoapUI-X.X.X.app/Contents/vmoptions.txt

Add the following line to the vmoptions.txt file:

-Dsoapui.https.protocols=TLSv1.2

LINUX

  1. Edit: bin/SoapUI-5.3.0.vmoptions in SoapUI directory

  2. Add the following line to the file:

-Dsoapui.https.protocols=TLSv1.2

I hope it helps.

Lluís
  • 1,267
  • 1
  • 14
  • 36
SergiSPN
  • 221
  • 1
  • 3
  • 8
    Thanks - NB: I had to omit the speech marks in the .vmoptions file (Windows), like so: `-Dsoapui.https.protocols=SSLv3,TLSv1.2` – ne1410s Sep 18 '17 at 13:54
  • If you are using windows 7 (for example, if you use iisexpress for dev) you have to enable TLSv1.2 protocol. See: https://www.derekseaman.com/2010/06/enable-tls-12-aes-256-and-sha-256-in.html – Gregor Slavec Mar 12 '18 at 12:31
  • 3
    Option1/Windows worked for me in SoapUI 5.3.0. However, I had to remove the quotes to make it work: -Dsoapui.https.protocols=SSLv3,TLSv1.2 – Yann Jul 13 '18 at 05:41
  • Unfortunately neither option worked for me; with or without quotation marks. – Jonathon Cowley-Thom Jun 25 '21 at 11:51
2

Tried all solutions but nothing worked. It started to work after ignoring jre directory in SoapUI. So if above solutions won't work for you then try this:

  1. Close SoapUI
  2. Go to SoapUi directory for example: C:\Program Files\SmartBear\SoapUI-5.3.0\
  3. Rename directory "jre" to "jre.ignore"
  4. Done. Open SoapUi and it should work now.
  • I don't understand why someone is downvoting this answer but this bug still occurs in new versions. Whole team of our developers had the sam issue. One week ago even my client had the same issue on Mac. Using default java instead of SoapUI java helps. Most likely mentioned issue can have multiple sources but better don't ignore this one because for me, my colleagues and my clients this solution always helps. – Krzysztof Cieśliński Jun 12 '18 at 18:04
  • 1
    This actually works! Don't know why, but this was the only solution that worked. – tok Nov 12 '19 at 06:48
  • When I rename the folder and restart SOAPUI, I get the message 'No JVM could be found on your system...' (SOAPUI 5.4.0) – Roeland Dec 08 '20 at 10:09
  • @Roeland do you have java installed and set java home (system variables path)? It could be related with that. – Krzysztof Cieśliński Dec 10 '20 at 17:11
  • Hi Krzysztof, I needed to install the 32 bit version instead on64 bit. However, now I still get the Connection Reset message – Roeland Dec 14 '20 at 08:20
0

I think you are using company connection and company firewall is blocking the connection.

Sumit Kumar
  • 249
  • 1
  • 7
  • He already has a connection he has written to it, and he is reading from it. **Ergo* the firewall isn't blocking it. – user207421 Apr 03 '17 at 06:12
0

In my case, none of the suggestions above were worked, except for this one. (I've added only this line to SoapUI-X.X.X.vmoptions file located in SergiSPN's answer above)

-Djava.net.preferIPv4Stack=true

There must have been some sort of restriction for IPv6 in our company's infrastructure, which I had no idea what it was.

LysanderM
  • 115
  • 1
  • 1
  • 6
-1

By removing protocols TLS 1.0 in the registry works fine.

Invoke-WebRequest SSL fails? this post is useful to resolve this issue.

Community
  • 1
  • 1
ChanGan
  • 4,254
  • 11
  • 74
  • 135
  • 2
    Could you please write a bit more detailed answer about "removing protocols in the registry"? – krzyski Oct 03 '18 at 07:29
-2

For testing purposes only: If all else fails, you can also just use http instead of https. Just edit the url in the SoapUI window for the request.

TomEberhard
  • 907
  • 10
  • 11