SSLException: Received fatal alert: certificate_unknown - what does it mean? - java

I am getting the "javax.net.ssl.SSLException: Received fatal alert: certificate_unknown" error when attempting to send a HTTPS message.
I believe the message is due to the endpoint not recognising the sent certificate or is rejecting it. But I want to be doubly sure this is a server issue and not a local client issue before I go barking up the wrong tree with my error analysis.
Can you guys please clarify the meaning of this error (google isn't helping much) and whether it is client or endpoint server related.
FYI: I am using Websphere Application Server 6.1
Edit: The stack trace is:
uk.gov.dwp.ifa.services.jef.CommandException: javax.net.ssl.SSLException: Received fatal alert: certificate_unknown
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(DashoA6275)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:502)
at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1973)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:993)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:393)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:168)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
at uk.gov.dwp.ifa.services.jef.commands.HttpRequestCommand.postMessage(HttpRequestCommand.java:406)
at uk.gov.dwp.ifa.services.jef.commands.HttpRequestCommand.evaluate(HttpRequestCommand.java:288)
at uk.gov.dwp.ifa.services.jef.AbstractController.evaluate(AbstractController.java:46)
at uk.gov.dwp.ifa.services.jef.SequentialAggregationController.evaluate(SequentialAggregationController.java:30)
at uk.gov.dwp.ifa.services.jef.FlowMaster.evaluate(FlowMaster.java:86)
at uk.gov.dwp.ifa.services.inbound.lite.servlet.InboundServlet.processRequest(InboundServlet.java:673)
at uk.gov.dwp.ifa.services.inbound.lite.servlet.InboundServlet.doPost(InboundServlet.java:232)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:930)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:761)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:673)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:498)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:112)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
at uk.gov.dwp.ifa.services.jef.commands.HttpRequestCommand.evaluate(HttpRequestCommand.java:302)
at uk.gov.dwp.ifa.services.jef.AbstractController.evaluate(AbstractController.java:46)
at uk.gov.dwp.ifa.services.jef.SequentialAggregationController.evaluate(SequentialAggregationController.java:30)
at uk.gov.dwp.ifa.services.jef.FlowMaster.evaluate(FlowMaster.java:86)
at uk.gov.dwp.ifa.services.inbound.lite.servlet.InboundServlet.processRequest(InboundServlet.java:673)
at uk.gov.dwp.ifa.services.inbound.lite.servlet.InboundServlet.doPost(InboundServlet.java:232)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:930)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:761)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:673)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:498)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:112)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
Caused by: javax.net.ssl.SSLException: Received fatal alert: certificate_unknown
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(DashoA6275)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:502)
at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1973)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:993)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:393)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:168)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
at uk.gov.dwp.ifa.services.jef.commands.HttpRequestCommand.postMessage(HttpRequestCommand.java:406)
at uk.gov.dwp.ifa.services.jef.commands.HttpRequestCommand.evaluate(HttpRequestCommand.java:288)
... 32 more

Related

javax.net.ssl.SSLHandshakeException from wildfly 10

I'm facing an issue about TLS connection to a secure site. my application deoloyed on wildfly-10. When calling a web service overs https, it raises the exception:
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:994) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1334)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1309)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:259)
at org.glassfish.jersey.client.internal.HttpUrlConnector$4.getOutputStream(HttpUrlConnector.java:385)
at org.glassfish.jersey.message.internal.CommittingOutputStream.commitStream(CommittingOutputStream.java:200)
at org.glassfish.jersey.message.internal.CommittingOutputStream.commitStream(CommittingOutputStream.java:194)
at org.glassfish.jersey.message.internal.CommittingOutputStream.write(CommittingOutputStream.java:228)
at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$UnCloseableOutputStream.write(WriterInterceptorExecutor.java:299)
at com.fasterxml.jackson.core.json.UTF8JsonGenerator._flushBuffer(UTF8JsonGenerator.java:1982)
at com.fasterxml.jackson.core.json.UTF8JsonGenerator.flush(UTF8JsonGenerator.java:995)
at com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:932)
at org.glassfish.jersey.jackson.internal.jackson.jaxrs.base.ProviderBase.writeTo(ProviderBase.java:648)
at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo(WriterInterceptorExecutor.java:265)
at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:250)
at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
at org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1130)
at org.glassfish.jersey.client.ClientRequest.doWriteEntity(ClientRequest.java:517)
at org.glassfish.jersey.client.ClientRequest.writeEntity(ClientRequest.java:499)
at org.glassfish.jersey.client.internal.HttpUrlConnector._apply(HttpUrlConnector.java:388)
at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:285)
... 284 more
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at sun.security.ssl.InputRecord.read(InputRecord.java:505)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:975)
... 309 more
I've enabled SSL logging with option -Djavax.net.debug=all. I noticed the following error:
[stdout] (default I/O-2) default I/O-2, fatal error: 80: Inbound closed before receiving peer's close_notify: possible truncation attack?
[stdout] (default I/O-2) javax.net.ssl.SSLException: Inbound closed before receiving peer's close_notify: possible truncation attack?
[stdout] (default I/O-2) %% Invalidated: [Session-2, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384]
[stdout] (default I/O-2) default I/O-2, SEND TLSv1.2 ALERT: fatal, description = internal_error
[stdout] (default I/O-2) default I/O-2, Exception sending alert: java.io.IOException: writer side was already closed.
[stdout] (default I/O-2) default I/O-2, called closeOutbound()
[stdout] (default I/O-2) default I/O-2, closeOutboundInternal()
Any idea about what might be the issue? Many thanks.

accessing ssl web service from the websphere 8.5.5.2

We have an java web application and we need to access a web service which is a https web service. So i add the ssl certificate to Websphere;
SSL certificate and key management > Key stores and certificates > NodeDefaultKeyStore > Signer Certificates
SSL certificate and key management > Key stores and certificates > NodeDefaultTrustStore > Signer Certificates
When application trying to access the web service an exception was thrown like this:
tr.biznet.msign.service.signature.SignatureException: Mobil signature certificate query is failed. Unknown error.
at tr.biznet.msign.service.signature.SignatureService.queryMobileSignCertificateRef(SignatureService.java:440)
at tr.biznet.msign.controller.signature.BsspController.queryMobileSignCertificateRef(BsspController.java:227)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:434)
at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:372)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:806)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:736)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:360)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1230)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:97)
at tr.biznet.msign.controller.NoCacheFilter.doFilter(NoCacheFilter.java:68)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:78)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:960)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1064)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3837)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:981)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:459)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:526)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:312)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:88)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1864)
Caused by: javax.xml.ws.WebServiceException: The following WSDL exception occurred: WSDLException: faultCode=WSDL4JWrapper : : javax.wsdl.WSDLException: WSDLException: faultCode=WSDL4JWrapper : : java.io.IOException: Server returned HTTP response code: 500 for URL: WEBSERVICELINK
at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:173)
at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70)
at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.setupWsdlDefinition(ServiceDescriptionImpl.java:1202)
at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.(ServiceDescriptionImpl.java:249)
at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.(ServiceDescriptionImpl.java:172)
at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:143)
at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:79)
at org.apache.axis2.jaxws.description.DescriptionFactory.createServiceDescription(DescriptionFactory.java:78)
at org.apache.axis2.jaxws.spi.ServiceDelegate.(ServiceDelegate.java:218)
at org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:83)
at org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:79)
at javax.xml.ws.Service.(Service.java:57)
at com.turkcelltech.mobilesignature.validation.soap.MSSProfileQueryService.(MSSProfileQueryService.java:50)
at tr.biznet.msign.service.signature.SignatureService.queryMobileSignCertificateRef(SignatureService.java:411)
... 50 more
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=WSDL4JWrapper : : javax.wsdl.WSDLException: WSDLException: faultCode=WSDL4JWrapper : : java.io.IOException: Server returned HTTP response code: 500 for URL: WEBSERVICELINK
at org.apache.axis2.jaxws.util.WSDL4JWrapper.commonPartsURLConstructor(WSDL4JWrapper.java:234)
at org.apache.axis2.jaxws.util.WSDL4JWrapper.(WSDL4JWrapper.java:156)
at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.setupWsdlDefinition(ServiceDescriptionImpl.java:1182)
... 61 more
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=WSDL4JWrapper : : java.io.IOException: Server returned HTTP response code: 500 for URL: WEBSERVICELINK
at org.apache.axis2.jaxws.util.WSDL4JWrapper.commonPartsURLConstructor(WSDL4JWrapper.java:203)
... 63 more
Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: WEBSERVICELINK
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1479)
at com.ibm.net.ssl.www2.protocol.https.b.getInputStream(b.java:63)
at org.apache.axis2.jaxws.util.WSDL4JWrapper$14.run(WSDL4JWrapper.java:974)
at org.apache.axis2.java.security.AccessController.doPrivileged(AccessController.java:132)
at org.apache.axis2.jaxws.util.WSDL4JWrapper.getInputStream(WSDL4JWrapper.java:971)
at org.apache.axis2.jaxws.util.WSDL4JWrapper.commonPartsURLConstructor(WSDL4JWrapper.java:189)
... 63 more
I masked the private web service address (WEBSERVICELINK)
On the other hand I tested the application with weblogic and tomcat. I can access the secure web service.
So i need some help about the websphere. Is there any configuration for this?
Problem
IBM Was use own axis framework for web service client. Problem is when you use third part library for web service client, (axis2, jax-ws) client code is generated by third part library. There can be a discrepancy between generated code and was ws library.
Solution
Use local classloader first for your application. (WAS administration console)
Enterprise Applications > "your_app" > Manage Modules > "module_name" > Custom properties
add: com.ibm.websphere.webservices.DisableIBMJAXWSEngine = true
Enterprise Applications > "your_app" > Manage Modules > "module_name"
select: "local classloader first (parent last)"
Enterprise Applications > "your_app" > Class loader
tick: Override class reloading settings for Web and EJB modules
tick: Classes loaded with local class loader first (parent last)
tick: Class loader for each WAR file in application

notnoop java-apns throw javax.net.ssl.SSLHandshakeException:Received fatal alert: handshake_failure

Detail
I using notnoop java-apns push mdm message,I try in main function push message is ok! but add into spring mvm run in jetty/tomcat web context throws javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure ! help me.
using spring mvc method
ModelAttribute
RequestMapping("/deviceinfo")
public String pushCommand(HttpServletRequest request)
{
String id = request.getParameter("id");
Device device = deviceManager.get(new Long(id));
log.debug(device);
log.debug(device.getToken());
ApnsService service = APNS.newService().withCert( ClassLoader
.getSystemResourceAsStream("mdm_push.p12"),"123456")
.withProductionDestination().build();
String mdmPayload = APNS.newPayload().mdm(device.getToken().getPushMagic()).build();
service.push(device.getToken().getToken(), mdmPayload);
log.warn("mdmDeviceInfoCommand");
return "device form";
}
error message:
INFO [Thread-19] ApnsConnectionImpl.run(170) | Exception while waiting for error code
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1959)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1077)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:882)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:102)
at java.io.InputStream.read(InputStream.java:101)
at >com.notnoop.apns.internal.ApnsConnectionImpl$1MonitoringThread.run(ApnsConnectionImpl.java:114)
DEBUG [qtp297885139-65] ApnsConnectionImpl.socket(218) | Made a new connection to APNS
INFO [Thread-20] ApnsConnectionImpl.run(170) | Exception while waiting for error code
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1959)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1077)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:882)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:102)
at java.io.InputStream.read(InputStream.java:101)
at >com.notnoop.apns.internal.ApnsConnectionImpl$1MonitoringThread.run(ApnsConnectionImpl.java:114)
INFO [qtp297885139-65] ApnsConnectionImpl.sendMessage(264) | Failed to send message >Message(Id=1; Token=07BE34F5A71A; Payload={"mdm":"E101CB39-697A-4883-B303-67713DEE836E"})... >trying again after delay
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1959)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1077)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:882)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:102)
at java.io.InputStream.read(InputStream.java:101)
at >com.notnoop.apns.internal.ApnsConnectionImpl$1MonitoringThread.run(ApnsConnectionImpl.java:114)
The suggestion from #artbristol will show you what the root cause is.
-Djavax.net.debug=ssl
Some examples:
bad/missing ciphers
bad/missing keystore information

JSON JAX-RS channel: Failed to find resource /HtmlDefaultRepresentation/defaultHtmlEntry.jsp

I have JAX-RS JSON channel:
#Path("/data")
public class DataChannel {
#GET
#Produces(MediaType.APPLICATION_JSON)
public Response getGridData(#HeaderParam("Range") String rangeHeader) {
The problem is that (usually) on first call I got the exception from Wink's HtmlProvider, while the subsequent calls are processed correclty and the JSON is returned:
0000006f servlet E
com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: An
exception was thrown by one of the service methods of the servlet
[de.datev.qmrzsv.rest.ApplicationConfig] in application [qmslmsv_ear].
Exception created : [javax.ws.rs.WebApplicationException:
com.ibm.ws.jsp.webcontainerext.JSPErrorReport: JSPG0036E: Failed to
find resource /HtmlDefaultRepresentation/defaultHtmlEntry.jsp at
org.apache.wink.server.internal.providers.entity.html.HtmlProvider.include(HtmlProvider.java:78)
at
org.apache.wink.server.internal.providers.entity.html.HtmlProvider.writeTo(HtmlProvider.java:112)
at
org.apache.wink.server.internal.providers.entity.html.HtmlProvider.writeTo(HtmlProvider.java:46)
at
org.apache.wink.server.internal.providers.entity.html.HtmlSyndEntryProvider.writeTo(HtmlSyndEntryProvider.java:81)
at
org.apache.wink.server.internal.providers.entity.html.HtmlSyndEntryProvider.writeTo(HtmlSyndEntryProvider.java:38)
at
org.apache.wink.common.internal.providers.entity.FormatedExceptionProvider.writeTo(FormatedExceptionProvider.java:108)
at
org.apache.wink.common.internal.providers.entity.FormatedExceptionProvider.writeTo(FormatedExceptionProvider.java:48)
at
org.apache.wink.server.internal.handlers.FlushResultHandler.handleResponse(FlushResultHandler.java:199)
at
org.apache.wink.server.handlers.AbstractHandler.handleResponse(AbstractHandler.java:38)
at
org.apache.wink.server.handlers.ResponseHandlersChain.handle(ResponseHandlersChain.java:26)
at
org.apache.wink.server.handlers.ResponseHandlersChain.handle(ResponseHandlersChain.java:22)
at
org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)
at
org.apache.wink.server.handlers.AbstractHandler.handleResponse(AbstractHandler.java:39)
at
org.apache.wink.server.handlers.ResponseHandlersChain.handle(ResponseHandlersChain.java:26)
at
org.apache.wink.server.handlers.ResponseHandlersChain.handle(ResponseHandlersChain.java:22)
at
org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)
at
org.apache.wink.server.handlers.AbstractHandler.handleResponse(AbstractHandler.java:39)
at
org.apache.wink.server.handlers.ResponseHandlersChain.handle(ResponseHandlersChain.java:26)
at
org.apache.wink.server.handlers.ResponseHandlersChain.handle(ResponseHandlersChain.java:22)
at
org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)
at
org.apache.wink.server.handlers.AbstractHandler.handleResponse(AbstractHandler.java:39)
at
org.apache.wink.server.handlers.ResponseHandlersChain.handle(ResponseHandlersChain.java:26)
at
org.apache.wink.server.handlers.ResponseHandlersChain.handle(ResponseHandlersChain.java:22)
at
org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)
at
org.apache.wink.server.internal.log.Responses.handleResponse(Responses.java:90)
at
org.apache.wink.server.handlers.ResponseHandlersChain.handle(ResponseHandlersChain.java:26)
at
org.apache.wink.server.handlers.ResponseHandlersChain.handle(ResponseHandlersChain.java:22)
at
org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)
at
org.apache.wink.server.handlers.AbstractHandler.handleResponse(AbstractHandler.java:39)
at
org.apache.wink.server.handlers.ResponseHandlersChain.handle(ResponseHandlersChain.java:26)
at
org.apache.wink.server.handlers.ResponseHandlersChain.handle(ResponseHandlersChain.java:22)
at
org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)
at
org.apache.wink.server.handlers.AbstractHandlersChain.run(AbstractHandlersChain.java:60)
at
org.apache.wink.server.internal.RequestProcessor.handleRequestWithoutFaultBarrier(RequestProcessor.java:232)
at
org.apache.wink.server.internal.RequestProcessor.handleRequest(RequestProcessor.java:154)
at
org.apache.wink.server.internal.servlet.RestServlet.service(RestServlet.java:124)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668) at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1225)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:775)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:457)
at
com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1032)
at
com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3761)
at
com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:975)
at
com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:459)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:526)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:312)
at
com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:87)
at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) at
com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905) at
com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1815) Caused by:
com.ibm.ws.jsp.webcontainerext.JSPErrorReport: JSPG0036E: Failed to
find resource /HtmlDefaultRepresentation/defaultHtmlEntry.jsp at
com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.findWrapper(AbstractJSPExtensionProcessor.java:447)
at
com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.getServletWrapper(AbstractJSPExtensionProcessor.java:338)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:965)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:1384)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:548)
at
org.apache.wink.server.internal.providers.entity.html.HtmlProvider.include(HtmlProvider.java:75)
... 58 more Caused by: java.io.FileNotFoundException: JSPG0036E:
Failed to find resource
/HtmlDefaultRepresentation/defaultHtmlEntry.jsp ... 64 more
The runtime environment is WebSphere server 8.5.
It looks as on the first time the wrong provider is chosen, the header explicitely states that JSON should be used as response. The HTTP headers sent from client side also implicite state that JSON is expected:
Accept text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Encoding gzip, deflate Accept-Language en,de;q=0.5
Content-Type application/json
What is causing that problem and how to avoid it?
Check the log for previous errors.
When the exception is thrown while generating response, the alternative provider (in that case - HtmlProvider) is used.
Exception can be caused by configuration problem or missing dependency.

WSSE Security Soap Header web service request returning response properly in SOAP UI but throwing exception in Java program

I got a servlet running in websphere. I am on the client's end.. I got to call a Apache CXF web service which expects a encrypted user id and password in soap header...it requires usage of WSSE Security Header..Now this request is working when fired in SOAP UI. But throwing security exception in Java.. I am putting in the SOAP Request and Exception here.. What am I missing? I googled and found little help
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="0">
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="EXTSYSTEMSADMIN">
<wsse:Username>lZvdO0sQNLqlxfDe4jUzgg==</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">za/jVwHhQROvEnGvXQHsOIbUiSdP3ZBrJXio6gQqMeU=</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
.......
</soapenv:Body>
</soapenv:Envelope>
This is the stack trace...
servlet E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Uncaught exception created in one of the service methods of the servlet xxxx in application XXX. Exception created : javax.xml.ws.soap.SOAPFaultException: An error was discovered processing the <wsse:Security> header
at org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.createSystemException(MethodMarshallerUtils.java:1310)
at org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.demarshalFaultResponse(MethodMarshallerUtils.java:1036)
at org.apache.axis2.jaxws.marshaller.impl.alt.DocLitWrappedMethodMarshaller.demarshalFaultResponse(DocLitWrappedMethodMarshaller.java:558)
at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.getFaultResponse(JAXWSProxyHandler.java:473)
at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.createResponse(JAXWSProxyHandler.java:436)
at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:351)
at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:159)
at $Proxy45.getDataFromClarity(Unknown Source)
at legal.vzwcorp.com.TestWS.doGet(TestWS.java:116)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1661)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:937)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:500)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3826)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)

Categories