Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8199652

Provide URI triggering a failure in the case of a SSLHandshakeException

    Details

      Description

      A DESCRIPTION OF THE REQUEST :
      When running my application I am getting this horrible stack-trace:

      java.util.concurrent.CompletionException: javax.ws.rs.ProcessingException: java.util.concurrent.ExecutionException: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
      at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
      at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
      at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1592)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
      Caused by: javax.ws.rs.ProcessingException: java.util.concurrent.ExecutionException: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
      at org.glassfish.jersey.jetty.connector.JettyConnector.apply(JettyConnector.java:273)
      at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:278)
      at org.glassfish.jersey.client.JerseyInvocation.lambda$invoke$1(JerseyInvocation.java:767)
      at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
      at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
      at org.glassfish.jersey.internal.Errors.process(Errors.java:229)
      at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:414)
      at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:765)
      at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:456)
      at org.glassfish.jersey.client.JerseyCompletionStageRxInvoker.lambda$method$1(JerseyCompletionStageRxInvoker.java:70)
      at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
      ... 3 common frames omitted
      Caused by: java.util.concurrent.ExecutionException: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
      at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118)
      at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101)
      at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:682)
      at org.glassfish.jersey.jetty.connector.JettyConnector.apply(JettyConnector.java:255)
      ... 13 common frames omitted
      Caused by: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
      at sun.security.ssl.Handshaker.checkThrown(Handshaker.java:1529)
      at sun.security.ssl.SSLEngineImpl.checkTaskThrown(SSLEngineImpl.java:535)
      at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:813)
      at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:781)
      at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)
      at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.fill(SslConnection.java:653)
      at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:125)
      at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:70)
      at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:137)
      at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:155)
      at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
      at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:289)
      at org.eclipse.jetty.io.ssl.SslConnection$3.succeeded(SslConnection.java:149)
      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
      at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
      ... 1 common frames omitted
      Caused by: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
      at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
      at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1728)
      at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:330)
      at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:322)
      at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1614)
      at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
      at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1052)
      at sun.security.ssl.Handshaker$1.run(Handshaker.java:992)
      at sun.security.ssl.Handshaker$1.run(Handshaker.java:989)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.security.ssl.Handshaker$DelegatedTask.run(Handshaker.java:1467)
      at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.fill(SslConnection.java:747)
      ... 15 common frames omitted
      Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:397)
      at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:240)
      at sun.security.validator.Validator.validate(Validator.java:260)
      at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
      at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:281)
      at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:136)
      at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1601)
      ... 22 common frames omitted
      Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
      at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
      at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
      at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:392)
      ... 28 common frames omitted

      I know that some asynchronous HTTP request is communicating with an untrusted host, but there is absolutely no way for me to know which of the hundreds async requests in my code are triggering this error.

      Please add the URI that triggered the exception to its message body.

      JUSTIFICATION :
      Extremely difficult for developers to figure out which URI is triggering an error without this information


        Attachments

          Activity

            People

            • Assignee:
              igerasim Ivan Gerasimov
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: