Code example for SSLContext

Methods: init

0
		private static SSLContext _sslc;
 
		static { 
			try { 
				_sslc = SSLContext.getInstance("TLS");
				_sslc.init(null, new TrustManager[] { new TrustAllManager() }, null);
			} catch(Exception e) { }
		} 
 
		@Override 
		public Socket connectSocket(Socket sock, String host, int port, InetAddress addr,
									int localPort, HttpParams params)
			throws IOException, UnknownHostException, ConnectTimeoutException { 
 
			int connTimeout = HttpConnectionParams.getConnectionTimeout(params);
			int soTimeout = HttpConnectionParams.getSoTimeout(params);
 
			InetSocketAddress rAddr = new InetSocketAddress(host, port);
			SSLSocket ssl = (SSLSocket)(sock != null ? sock : createSocket());
 
			if(addr != null || localPort > 0) {