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

ALPN: getHandshakeApplicationProtocol() always return null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • security-libs
    • b102
    • Verified

        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.

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

                Created:
                Updated:
                Resolved: