Code example for SSLContext

Methods: getSocketFactory

0
			return createAndroidSSLSocketFactory(); 
		} 
		if(sslContext == null) {
			return (SSLSocketFactory) SSLSocketFactory.getDefault();
		} else { 
			return sslContext.getSocketFactory();
		} 
	} 
 
	private SSLSocketFactory createAndroidSSLSocketFactory() {
		if(sslContext == null) {
			try { 
				return new AndroidSSLSocketFactory(); 
			} catch (NoSuchAlgorithmException e) {
				logger.severe("Failed to create default ssl context");
				System.exit(1);
				return null; 
			} 
		} else { 
			return new AndroidSSLSocketFactory(sslContext);
		}