The javax.net.ssl package has recently been enhanced so that it supports the Transport Layer Security (TLS) ALPN (short for Application-Layer Protocol Negotiation) extension. This extension permits application protocol negotiation for TLS connections.
The TLS application-layer protocol negotiation extension
TLS ALPN extension
ALPN is a TLS extension and can be used to negotiate regarding which protocol to implement when using a secure connection. ALPN represents an efficient means of negotiating protocols. As indicated in the following diagram, there are five basic steps to TLS handshakes:
The five steps of TLS handshakes