Code example for SSLContext

Methods: init

0
	            public X509Certificate[] getAcceptedIssuers() {
	                return null; 
	            } 
	        }; 
 
	        sslContext.init(null, new TrustManager[] { tm }, null);
	    } 
 
	    @Override 
	    public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException, UnknownHostException {
	        return sslContext.getSocketFactory().createSocket(socket, host, port, autoClose);
	    } 
 
	    @Override 
	    public Socket createSocket() throws IOException {
	        return sslContext.getSocketFactory().createSocket();
	    } 
	} 
 
	// Our own HttpClient that uses the SSLSocketFactory above and modifies a few params 
	public HttpClient getNewHttpClient() {