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

8u251 java.lang.AssertionError: failed to get ALPN selected protocol

XMLWordPrintable

      Submitter has updated JDK from jdk 1.8.0.241 to jdk 1.8.0.251, using okhttp3
      (3.13.1) for sending http request, after jdk upgrade okhttp3 call is failing
      with AssertionError "failed to get ALPN selected protocol"

      Detailed stacktrace :

      Exception in thread "main" java.lang.AssertionError: failed to get ALPN selected protocol
      at okhttp3.internal.platform.Jdk9Platform.getSelectedProtocol(Jdk9Platform.java:68)
      at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:347)
      at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:284)
      at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:169)
      at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:257)
      at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
      at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
      at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
      at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
      at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
      at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
      at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
      at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
      at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
      at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
      at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125)
      at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
      at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
      at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:264)
      at okhttp3.RealCall.execute(RealCall.java:93)
      at testokhttp.DemoCasImpl3.main(DemoCasImpl3.java:140)
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at okhttp3.internal.platform.Jdk9Platform.getSelectedProtocol(Jdk9Platform.java:58)
      ... 20 more
      Caused by: java.lang.UnsupportedOperationException
      at javax.net.ssl.SSLSocket.getApplicationProtocol(SSLSocket.java:691)

      With jdk 1.8.0.241, okhttp3 call works fine.

      ***NOTE***
      indication of possible regression.

      8u251 Release Notes mentions the following
      JDK 8u251 RN
      https://www.oracle.com/technetwork/java/javase/8u251-relnotes-5972664.html

      New Features
      security-libs/javax.net.ssl
      ➜ TLS Application-Layer Protocol Negotiation Extension

      JEP 244 has enhanced the Java Secure Socket Extension (JSSE) to provide
      support for the TLS Application-Layer Protocol Negotiation Extension (RFC
      7301). New methods have been added to the javax.net.ssl classes SSLEngine,
      SSLSocket, and SSLParameters to allow clients and servers to negotiate an
      application layer value as part of the TLS handshake.
      See JDK-8051498 / JDK-8230977

            coffeys Sean Coffey
            shadowbug Shadow Bug
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: