Java examples for Network:SSL
create SSL Hostname Verifier
//package com.java2s; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLSession; public class Main { public static void main(String[] argv) throws Exception { String apiHostname = "java2s.com"; System.out.println(createSSLHostnameVerifier(apiHostname)); }/* ww w . ja v a 2 s .c o m*/ public static HostnameVerifier createSSLHostnameVerifier( final String apiHostname) { HostnameVerifier hostnameVerifier = new HostnameVerifier() { @Override public boolean verify(String hostname, SSLSession session) { //Logcat.d("HostnameVerifier.verify(): " + hostname + " / " + apiHostname); return hostname.equals(apiHostname); } }; return hostnameVerifier; } }