We are migrating a project from JDK8 to JDK11 (compile) and JDK17(execution).
I have put in many hours and almost succeeded, but there’s a bug that I can’t fix or get around.
When I do a request using JAX-WS, I got this error
com.sun.xml.ws.client.ClientTransportException: HTTP transport error: java.io.IOException: HTTPS hostname wrong: should be <mango-qatrips-simu-01>
at com.sun.xml.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:102)
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:193)
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:115)
at com.sun.xml.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:109)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1106)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:1020)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:989)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:847)
at com.sun.xml.ws.client.Stub.process(Stub.java:433)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:161)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:62)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:131)
at jdk.proxy2/jdk.proxy2.$Proxy81.es4GetEIS(Unknown Source)
at mycode.MsgES4SmSrImpl.lambda$getEIS$3(SubscriptionMngES4SmSrImpl.java:140)
at mycode.MsgES4SmSrImpl.getEIS(SubscriptionMngES4SmSrImpl.java:144)
[...]
Caused by: java.io.IOException: HTTPS hostname wrong: should be <my-server-simu-01>
at java.base/sun.net.www.protocol.https.HttpsClient.checkURLSpoofing(HttpsClient.java:670)
at java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:603)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:187)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1430)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1401)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:220)
at com.sun.xml.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:89)
... 49 common frames omitted
This error didn’t appear with JDK8, but it can not be avoided with JDK11/17 (unless I deactivagte https, which is not an option)
I tried to disabling https (which work perfectly but’s not an option) and dig in the code to see if there’s an option, but with no luck.
We are using this libraries
com.sun.xml.ws:jaxws-rt = 2.3.3
com.sun.xml.ws:jaxws-tools = 2.3.3
I know it’s a SSL cetification error, but I want to know how to avoid it like it was in JDK8; without touching the SSL certificate part.
Any ideas ?
Thanks in advance