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

ALPN: getHandshakeApplicationProtocol() always return null

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: security-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b102
    • Verification:
      Verified

      Backports

        Description

        Attached file HandShakeALPN.java is for checking ALPN value during TLS handshake, the test creates X509KeyManager for the Server and X509TrustManager for the Client respectively. When they are called to provide and check key material, check that the ALPN values are correct.
        The attached test fails because the method getHandshakeApplictionProtocol() in SSLSocket class always returns null.

        java.base/share/classes/sun/security/ssl/SSLSocketImpl.java
        Line 2588 -2593:
            public synchronized String getHandshakeApplicationProtocol() {
                if ((handshaker != null) && !handshaker.started()) {
                    return handshaker.getHandshakeApplicationProtocol();
                }
                return null;
            }

        if TLS Handshake is on-going, "!handshaker.started()" returns false , if TLS Handshake is completed, "handshaker != null" returns false. so this method will always return null, whenever TLS Handshake is on-going or done.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                amjiang Amanda Jiang (Inactive)
                Reporter:
                amjiang Amanda Jiang (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: