Code example for SSLSocketFactory

Methods: setHostnameVerifier

			Context context) {
		try { 
			// Pass the keystore to the SSLSocketFactory. The factory is 
			// responsible 
			// for the verification of the server certificate. 
			SSLSocketFactory sf = new SSLSocketFactory(loadOWKeyStore(context));
			// Hostname verification from certificate 
			return sf;
		} catch (Exception e) {
			throw new AssertionError(e);
	private static KeyStore loadOWKeyStore(Context c) {
		KeyStore trusted = null;
		try { 
			// Get an instance of the Bouncy Castle KeyStore format 
Experience pair programming with AI  Get Codota for Java