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:
![](https://static.packt-cdn.com/products/9781789137613/graphics/assets/364a8bb5-a723-4e9e-98f3-536d1047297c.png)
The five steps of TLS handshakes