javapns/src/main/java/javapns/communication/ConnectionToAppleServer.java
/**
	 * Generic SSLSocketFactory builder
	 *
	 * @param trustManagers
	 * @return SSLSocketFactory
	 * @throws Exception
	 */
Generic SSLSocketFactory builder
@param trustManagers
@return SSLSocketFactory
@throws Exception
Generic SSLSocketFactory builder @param trustManagers @return SSLSocketFactory @throws Exception
protected SSLSocketFactory createSSLSocketFactoryWithTrustManagers(TrustManager[] trustManagers) throws Exception {
		logger.debug("Creating SSLSocketFactory");
		KeyStore keystore = getKeystore();
		KeyManagerFactory kmf = KeyManagerFactory.getInstance(ALGORITHM);
		try {
			char[] password = KeystoreManager.getKeystorePasswordForSSL(server);
			kmf.init(keystore, password);
		} catch (Exception e) {
			e = KeystoreManager.getSimplerSSLException(e);
			throw e;
		}
		SSLContext sslc = SSLContext.getInstance(PROTOCOL);
		sslc.init(kmf.getKeyManagers(), trustManagers, null);
		return sslc.getSocketFactory();
	}
protected SSLSocketFactory createSSLSocketFactoryWithTrustManagers ( TrustManager [ ] trustManagers ) throws Exception { logger . debug ( "Creating SSLSocketFactory" ) ; KeyStore keystore = getKeystore ( ) ; KeyManagerFactory kmf = KeyManagerFactory . getInstance ( ALGORITHM ) ; try { char [ ] password = KeystoreManager . getKeystorePasswordForSSL ( server ) ; kmf . init ( keystore , password ) ; } catch ( Exception e ) { e = KeystoreManager . getSimplerSSLException ( e ) ; throw e ; } SSLContext sslc = SSLContext . getInstance ( PROTOCOL ) ; sslc . init ( kmf . getKeyManagers ( ) , trustManagers , null ) ; return sslc . getSocketFactory ( ) ; }
Generic SSLSocketFactory builder
 @param trustManagers
 @return SSLSocketFactory
 @throws Exception
Generic SSLSocketFactory builder @param trustManagers @return SSLSocketFactory @throws Exception
// Get a KeyManager and initialize it // Get the SSLContext to help create SSLSocketFactory