and hint to missing ALPN
Note this doesn't add alpn (same as openssl). See here https://docs.oracle.com/javase/8/docs/api/javax/net/ssl/SSLSocket.html if you want to add that. This code is NOT GPLv2! It was taken from the Oracle web site which didn't list any license (https://docs.oracle.com/javase/10/security/sample-code-illustrating-secure-socket-connection-client-and-server.htm).