Code example for AllowAllHostnameVerifier

0
		super(null); 
 
		SSLContext sslcontext = SSLContext.getInstance("TLS");
		sslcontext.init(null, new TrustManager[] { new TrustAllManager() }, null);
		this.factory = sslcontext.getSocketFactory();
		this.setHostnameVerifier(new AllowAllHostnameVerifier());
	} 
 
	public static SocketFactory getDefault() throws Exception {
		return new TrustAllSSLSocketFactory(); 
	} 
 
	@Override 
	public Socket createSocket() throws IOException {
		return this.factory.createSocket();
	} 
 
	@Override 
	public Socket createSocket(Socket socket, String s, int i, boolean flag) throws IOException {
		return this.factory.createSocket(socket, s, i, flag);
	}