Unable to consume secured webservice - getting java.net.SocketException: Connection reset

Hi Experts,

We are unable to invoke the https secured webservices from IS using pub.client:https where we have added required certificates in our trust store also.

Getting Connection Reset during RAW write as per wrapper.log (set wrapper.java.additional.401=-Djavax.net.debug=all).

Please advise if anybody as faced same issue and any pointers would be appreciated.

The same endpoint we are able to invoke successfully from POSTMAN but getting same connection reset from SOAPUI

in Wrapper.log

 | 2023/04/07 11:29:27 | javax.net.ssl|DEBUG|15 88|HTTP Handler 127.0.0.1|2023-04-07 11:29:27.929 IST|SSLSocketOutputRecord.java:349|Raw write (
INFO   | jvm 1    | 2023/04/07 11:29:27 |   0000: 17 03 03 01 1A 00 00 00   00 00 00 00 01 CC 3F 8B  ..............?.
INFO   | jvm 1    | 2023/04/07 11:29:27 |   0010: 60 97 41 FB 94 7C 54 A5   59 49 1B F2 8F 26 9D BB  `.A...T.YI...&..
INFO   | jvm 1    | 2023/04/07 11:29:27 |   0020: A2 41 9A 3F 1B 35 00 53   2F 90 63 E7 36 56 06 56  .A.?.5.S/.c.6V.V
INFO   | jvm 1    | 2023/04/07 11:29:27 |   0030: 4A C3 A7 43 9A EE 72 1D   33 26 59 40 FB 0B CC 0F  J..C..r.3&Y@....
INFO   | jvm 1    | 2023/04/07 11:29:27 |   0040: 3E 9F DC A8 E8 82 2F 34   60 0D 11 2B 5A 60 45 AA  >...../4`..+Z`E.
INFO   | jvm 1    | 2023/04/07 11:29:27 |   0050: 2D 18 1C 4C 3C 6B EF 2C   30 07 3D B3 F5 7D F3 28  -..L<k.,0.=....(
INFO   | jvm 1    | 2023/04/07 11:29:27 |   0060: E3 33 61 00 CA 7B E2 13   C7 3C 8E B8 E1 9D F3 CA  .3a......<......
INFO   | jvm 1    | 2023/04/07 11:29:27 |   0070: 32 F4 FE 5C EB 38 B8 3D   F2 79 07 AC 34 A3 B2 A2  2..\.8.=.y..4...
INFO   | jvm 1    | 2023/04/07 11:29:27 |   0080: F9 6D 94 CF 1B 5D BC 1C   57 B8 74 93 22 F2 40 6E  .m...]..W.t.".@n
INFO   | jvm 1    | 2023/04/07 11:29:27 |   0090: CA 87 BD 4C 50 2C C8 DA   EE BB 14 07 B4 C8 32 18  ...LP,........2.
INFO   | jvm 1    | 2023/04/07 11:29:27 |   00A0: DC 81 B7 16 DA 6F 2C C6   B6 1B 99 A9 22 AF 56 30  .....o,.....".V0
INFO   | jvm 1    | 2023/04/07 11:29:27 |   00B0: F9 C5 41 98 E8 78 33 FE   EF 4E 07 09 10 DE A6 83  ..A..x3..N......
INFO   | jvm 1    | 2023/04/07 11:29:27 |   00C0: AA 22 2F 35 FA 21 13 F5   07 86 AB 56 A0 DB C5 50  ."/5.!.....V...P
INFO   | jvm 1    | 2023/04/07 11:29:27 |   00D0: FC 58 AA 40 2B 8A 14 1E   C4 F8 67 9C BF F7 78 4B  .X.@+.....g...xK
INFO   | jvm 1    | 2023/04/07 11:29:27 |   00E0: 11 DB E4 21 08 8D 76 5E   A7 74 50 6E 01 26 4F 27  ...!..v^.tPn.&O'
INFO   | jvm 1    | 2023/04/07 11:29:27 |   00F0: 11 64 21 DC 63 F5 8B 5C   5F AE 5C 14 BA 14 AE 75  .d!.c..\_.\....u
INFO   | jvm 1    | 2023/04/07 11:29:27 |   0100: 9F 76 53 14 80 12 27 42   A0 F8 FD 15 A7 F7 E4 A1  .vS...'B........
INFO   | jvm 1    | 2023/04/07 11:29:27 |   0110: 2E 38 32 60 C9 57 D3 65   E5 5E 98 5C 24 B4 AC     .82`.W.e.^.\$..
INFO   | jvm 1    | 2023/04/07 11:29:27 | )
INFO   | jvm 1    | 2023/04/07 11:29:28 | javax.net.ssl|WARNING|15 88|HTTP Handler 127.0.0.1|2023-04-07 11:29:28.338 IST|SSLSocketImpl.java:1653|handling exception (
INFO   | jvm 1    | 2023/04/07 11:29:28 | "throwable" : {
INFO   | jvm 1    | 2023/04/07 11:29:28 |   java.net.SocketException: Connection reset
INFO   | jvm 1    | 2023/04/07 11:29:28 |   	at java.base/java.net.SocketInputStream.read(SocketInputStream.java:186)
INFO   | jvm 1    | 2023/04/07 11:29:28 |   	at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
INFO   | jvm 1    | 2023/04/07 11:29:28 |   	at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:478)
INFO   | jvm 1    | 2023/04/07 11:29:28 |   	at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:472)
INFO   | jvm 1    | 2023/04/07 11:29:28 |   	at java.base/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocketInputRecord.

Error in Designer

com.wm.app.b2b.server.ServiceException: java.net.SocketException: Connection reset
at pub.clientimpl.http(clientimpl.java:2209)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:405)
at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:761)
at wm.bci.internal.BciServiceInvokeNotifier.process(BciServiceInvokeNotifier.java:53)
at com.wm.ps.serviceMock.ServiceInterceptor.process(ServiceInterceptor.java:360)
at com.wm.app.b2b.server.util.tspace.ReservationProcessor.process(ReservationProcessor.java:39)
at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:67)
at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:243)
at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
at com.wm.app.b2b.server.invoke.PipelineProcessor.process(PipelineProcessor.java:171)
at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:336)
at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:33)
at com.wm.app.b2b.server.invoke.ConcurrentRequestLimitProcessor.process(ConcurrentRequestLimitProcessor.java:57)
at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:399)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:631)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:436)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:394)
at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:260)
at com.wm.app.b2b.server.BaseService.invoke(BaseService.java:236)
at com.wm.lang.flow.FlowInvoke.invoke(FlowInvoke.java:263)
at com.wm.lang.flow.FlowState.invokeNode(FlowState.java:662)
at com.wm.lang.flow.FlowState.step(FlowState.java:527)
at com.wm.lang.flow.FlowState.invoke(FlowState.java:494)
at com.wm.app.b2b.server.FlowSvcImpl.baseInvoke(FlowSvcImpl.java:1164)
at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:761)
at wm.bci.internal.BciServiceInvokeNotifier.process(BciServiceInvokeNotifier.java:53)
at com.wm.ps.serviceMock.ServiceInterceptor.process(ServiceInterceptor.java:360)
at com.wm.app.b2b.server.util.tspace.ReservationProcessor.process(ReservationProcessor.java:39)
at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:67)
at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:243)
at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
at com.wm.app.b2b.server.invoke.PipelineProcessor.process(PipelineProcessor.java:171)
at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:336)
at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:33)
at com.wm.app.b2b.server.invoke.ConcurrentRequestLimitProcessor.process(ConcurrentRequestLimitProcessor.java:57)
at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:399)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:631)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:436)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:394)
at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:260)
at com.wm.app.b2b.server.comm.DefaultServerRequestHandler.handleMessage(DefaultServerRequestHandler.java:119)
at com.wm.app.b2b.server.HTTPMessageHandler.process(HTTPMessageHandler.java:156)
at com.wm.app.b2b.server.HTTPDispatch.handleRequest(HTTPDispatch.java:203)
at com.wm.app.b2b.server.Dispatch.run(Dispatch.java:391)
at com.wm.util.pool.PooledThread.run(PooledThread.java:127)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.net.SocketException: Connection reset
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:186)
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:478)
at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:472)
at java.base/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocketInputRecord.java:70)
at java.base/sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java:1454)
at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:1065)
at java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:252)
at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:271)
at com.wm.net.HttpInputStream.readHeaderUntil(HttpInputStream.java:473)
at com.wm.net.HttpInputStream.readHeaderUntil(HttpInputStream.java:467)
at com.wm.net.HttpInputStream.readStatus(HttpInputStream.java:855)
at com.wm.net.HttpInputStream.readHeader(HttpInputStream.java:210)
at com.wm.net.HttpHeader.read(HttpHeader.java:607)
at com.wm.net.NetURLConnection.getInputStream(NetURLConnection.java:388)
at com.wm.net.NetURLConnection.getInputStream(NetURLConnection.java:215)
at com.wm.net.HttpContext.getFinalInputStream(HttpContext.java:1070)
at com.wm.net.HttpContext.getInputStream(HttpContext.java:424)
at com.wm.net.HttpContext.getInputStream(HttpContext.java:395)
at com.wm.net.HttpContext.get(HttpContext.java:438)
at com.wm.net.HttpContext.get(HttpContext.java:445)
at pub.clientimpl.http(clientimpl.java:2044)
... 49 more

I had a similar issue. AFAIK SOAPUI is Java based and Postman is not.
Connection reset Exception can be a red herring. Is the remote service you are trying to invoke hosted in IIS? If it is follow these steps to isolate the problem.

Try invoking the same service with a simple java application.
If you get the same error tell or ask the service owner to move the service to another server for testing or use a different server if they have one already. Sometimes IIS cause connection resets and unfortunately I don’t know the exact cause. We tried to fix it with several windows admins but we weren’t successful.

The weird thing was only java applications were experiencing the connection reset error and even from a console java application we didn’t get any useful exceptions to fix the issue.

Hope this helps.

Hi Niranth,

additionally I would suggest that you get in contact with the admins of the target server to check if they have something in their logs.

Is there anything in IS server.log invoking the pub.client:http service?
Might there be some information in the response structure of the pub.client:http service?

Regards,
Holger

Thanks @engin_arlak , @Holger_von_Thomsen for your response.

@engin_arlak, noted on your comments and will have to check with actual provider of the endpoint.

@Holger_von_Thomsen, Both in wrapper.log and server.log we could see only error related to connection reset and nothing useful. With the help of wireshark able to see that the server is sending connection reset.

Thanks

By the way, it happened to me when Windows Admins were updating TLS protocols to 1.3 but reverting it back to 1.2 didn’t help me. It may be a good idea to double check those settings as well. Below there is a link to a really similar case to mine.

Hope this helps.

Hi @engin_arlak

Thanks for your response, appreciate it.

Fortunately, able to solve the issue :slight_smile:

I just compared today whats the difference in payload data sent from postman vs our IS, able to find that there will be a hidden request header ‘Host’ will be sent which is nothing but the hostname from endpoint url.

The endpoint url we are calling had a Camel case and postman was setting the ‘Host’ with all small cases in the hostname, so we tried same by calling the hostname with all small cases in the endpoint url and it workedddd.

Regards,
Niranth

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.