// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.security.NoSuchAlgorithmException;

import javax.net.ssl.SSLContext;

public class TLSVersions {
    private static void test(String protocol) {
        try {
            SSLContext.getInstance(protocol);
            System.out.println(protocol + " is supported");
        } catch (NoSuchAlgorithmException e) {
            System.out.println(protocol + " is NOT supported");
        }
    }
    public static void main(String[] args) {
        test("SSLv3");
        test("TLSv1");
        test("TLSv1.1");
        test("TLSv1.2");
        test("TLSv1.3");
    }
}
