/** * Set the default Hostname Verifier to an instance of a dummy class that trust all host names. */ public static void trustAllHostnames() { // Create a verifier that does not validate host names if (instance.hostnameVerifier == null) { synchronized (instance) { if (instance.hostnameVerifier == null) { // if several threads had waited for entering the synchronized block instance.hostnameVerifier = new DefaultHostnameVerifier(); // Install the all-trusting host name verifier: HttpsURLConnection.setDefaultHostnameVerifier(instance.hostnameVerifier); } } } }
.hostnameVerifier(new SslUtils.DefaultHostnameVerifier()); clientIdKeys.add("cert_file=" + clientConfigurator.getCertificateFileName());