Code example for SSLSocketFactory

Methods: createSocket, setHostnameVerifier

0
 
				KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
				trustStore.load(null, null);
 
				socketFactory = new EasySSLSocketFactory(trustStore);
				socketFactory.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
				s = new Socket(LE_API, LE_PORT);
				socket = (SSLSocket)socketFactory.createSocket(s, "", 0, true);
				socket.setTcpNoDelay(true);
				stream = socket.getOutputStream();
 
				dbg( "Connection established"); 
			} catch (Exception e){ }
		} 
 
		/** 
		 * Tries to open connection to Logentries until it succeeds 
		 * 
		 * @throws InterruptedException 
		 */ 
		void reopenConnection() throws InterruptedException {