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

HTTP/2 client may fail with NPE if additional logging enabled

    Details

    • Subcomponent:
    • Resolved In Build:
      b120
    • Verification:
      Verified

      Description

      NPE occurs if additional logging is enabled with "java.net.http.HttpClient.log" system property:

      java.lang.NullPointerException
      at java.net.http.AsyncSSLDelegate.logParams(java.httpclient@9-internal/AsyncSSLDelegate.java:570)
      at java.net.http.AsyncSSLDelegate.<init>(java.httpclient@9-internal/AsyncSSLDelegate.java:148)
      at java.net.http.AsyncSSLConnection.<init>(java.httpclient@9-internal/AsyncSSLConnection.java:43)
      at java.net.http.HttpConnection.getSSLConnection(java.httpclient@9-internal/HttpConnection.java:161)
      at java.net.http.HttpConnection.getConnectionImpl(java.httpclient@9-internal/HttpConnection.java:196)
      at java.net.http.HttpConnection.getConnection(java.httpclient@9-internal/HttpConnection.java:95)
      at java.net.http.Http2Connection.<init>(java.httpclient@9-internal/Http2Connection.java:175)
      at java.net.http.Http2ClientImpl.getConnectionFor(java.httpclient@9-internal/Http2ClientImpl.java:99)
      at java.net.http.ExchangeImpl.get(java.httpclient@9-internal/ExchangeImpl.java:64)
      at java.net.http.Exchange.responseImpl0(java.httpclient@9-internal/Exchange.java:134)
      at java.net.http.Exchange.responseImpl(java.httpclient@9-internal/Exchange.java:127)
      at java.net.http.Exchange.response(java.httpclient@9-internal/Exchange.java:84)
      at java.net.http.MultiExchange.response(java.httpclient@9-internal/MultiExchange.java:98)
      at java.net.http.HttpRequestImpl.response(java.httpclient@9-internal/HttpRequestImpl.java:212)
      at TLSConnection.connect(TLSConnection.java:136)
      at TLSConnection.lambda$main$1(TLSConnection.java:81)
      at TLSConnection.expectSuccess(TLSConnection.java:145)
      at TLSConnection.main(TLSConnection.java:79)
      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-internal/Native Method)
      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-internal/NativeMethodAccessorImpl.java:62)
      at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-internal/DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(java.base@9-internal/Method.java:531)
      at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:110)
      at java.lang.Thread.run(java.base@9-internal/Thread.java:804)


      It happens because AsyncSSLDelegate.logParams(SSLParameters) doesn't check for null values which were returned by SSLParameters instance.

        Attachments

          Activity

            People

            • Assignee:
              asmotrak Artem Smotrakov
              Reporter:
              asmotrak Artem Smotrakov
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: