/** * Performs a lazy init of the SSL context * @throws IOException */ private void initSslContext() throws IOException { if (context == null) { context = SSLContextUtils.createSSLContext(protocol, getKeyManager(), getTrustManager()); } }
/** * Performs a lazy init of the SSL context * @throws IOException */ private void initSslContext() throws IOException { if(context == null) { try { context = SSLContext.getInstance(protocol); context.init(new KeyManager[] { getKeyManager() } , new TrustManager[] { getTrustManager() } , null); } catch (KeyManagementException e) { IOException ioe = new IOException("Could not initialize SSL context"); ioe.initCause(e); throw ioe; } catch (NoSuchAlgorithmException e) { IOException ioe = new IOException("Could not initialize SSL context"); ioe.initCause(e); throw ioe; } } }