List of usage examples for javax.net.ssl HttpsURLConnection getCipherSuite
public abstract String getCipherSuite();
From source file:com.ct855.util.HttpsClientUtil.java
private void print_https_cert(HttpsURLConnection con) { if (con != null) { try {/* w w w. jav a2 s. c om*/ System.out.println("Response Code : " + con.getResponseCode()); System.out.println("Cipher Suite : " + con.getCipherSuite()); System.out.println("\n"); Certificate[] certs = con.getServerCertificates(); for (Certificate cert : certs) { System.out.println("Cert Type : " + cert.getType()); System.out.println("Cert Hash Code : " + cert.hashCode()); System.out.println("Cert Public Key Algorithm : " + cert.getPublicKey().getAlgorithm()); System.out.println("Cert Public Key Format : " + cert.getPublicKey().getFormat()); System.out.println("\n"); } } catch (SSLPeerUnverifiedException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }