/** * @see SSLContexts#createDefault() */ public static final SSLContext getPreferredSSLContext(final SecureRandom secureRandom) { try { final SSLContext sslcontext = SSLContext.getInstance("TLS"); // http://download.java.net/jdk9/docs/technotes/guides/security/jsse/JSSERefGuide.html sslcontext.init(null, null, secureRandom); return sslcontext; } catch (final NoSuchAlgorithmException ex) { throw new SSLInitializationException(ex.getMessage(), ex); } catch (final KeyManagementException ex) { throw new SSLInitializationException(ex.getMessage(), ex); } } }
private SSLContext buildSslContext() throws SSLInitializationException { final SSLContext sslContext; try { final SSLContextBuilder sslContextBuilder = new SSLContextBuilder(); sslContextBuilder.setProtocol(configuration.getProtocol()); final String configuredProvider = configuration.getProvider(); if (configuredProvider != null) { sslContextBuilder.setProvider(configuredProvider); } loadKeyMaterial(sslContextBuilder); loadTrustMaterial(sslContextBuilder); sslContext = sslContextBuilder.build(); } catch (Exception e) { throw new SSLInitializationException(e.getMessage(), e); } return sslContext; }
/** * @see SSLContexts#createDefault() */ public static final SSLContext getPreferredSSLContext(final SecureRandom secureRandom) { try { final SSLContext sslcontext = SSLContext.getInstance("TLS"); // http://download.java.net/jdk9/docs/technotes/guides/security/jsse/JSSERefGuide.html sslcontext.init(null, null, secureRandom); return sslcontext; } catch (final NoSuchAlgorithmException ex) { throw new SSLInitializationException(ex.getMessage(), ex); } catch (final KeyManagementException ex) { throw new SSLInitializationException(ex.getMessage(), ex); } } }
private static SSLContext getPreferredSslContext() { try { final SSLContext sslcontext = SSLContext.getInstance("TLS"); // http://download.java.net/jdk9/docs/technotes/guides/security/jsse/JSSERefGuide.html sslcontext.init(null, null, null); return sslcontext; } catch (final NoSuchAlgorithmException | KeyManagementException ex) { throw new SSLInitializationException(ex.getMessage(), ex); } }
/** * @see SSLContexts#createDefault() */ public static final SSLContext getPreferredSSLContext(final SecureRandom secureRandom) { try { final SSLContext sslcontext = SSLContext.getInstance("TLS"); // http://download.java.net/jdk9/docs/technotes/guides/security/jsse/JSSERefGuide.html sslcontext.init(null, null, secureRandom); return sslcontext; } catch (final NoSuchAlgorithmException ex) { throw new SSLInitializationException(ex.getMessage(), ex); } catch (final KeyManagementException ex) { throw new SSLInitializationException(ex.getMessage(), ex); } } }
/** * Creates default factory based on the standard JSSE trust material * (<code>cacerts</code> file in the security properties directory). System properties * are not taken into consideration. * * @return the default SSL socket factory */ public static SSLContext createDefault() throws SSLInitializationException { try { final SSLContext sslcontext = SSLContext.getInstance(SSLContextBuilder.TLS); sslcontext.init(null, null, null); return sslcontext; } catch (final NoSuchAlgorithmException ex) { throw new SSLInitializationException(ex.getMessage(), ex); } catch (final KeyManagementException ex) { throw new SSLInitializationException(ex.getMessage(), ex); } }
/** * @see SSLContexts#createDefault() */ public static final SSLContext getPreferredSSLContext(final SecureRandom secureRandom) { try { final SSLContext sslcontext = SSLContext.getInstance("TLS"); // http://download.java.net/jdk9/docs/technotes/guides/security/jsse/JSSERefGuide.html sslcontext.init(null, null, secureRandom); return sslcontext; } catch (final NoSuchAlgorithmException ex) { throw new SSLInitializationException(ex.getMessage(), ex); } catch (final KeyManagementException ex) { throw new SSLInitializationException(ex.getMessage(), ex); } } }
/** * Creates default factory based on the standard JSSE trust material * (<code>cacerts</code> file in the security properties directory). System properties * are not taken into consideration. * * @return the default SSL socket factory */ public static SSLContext createDefault() throws SSLInitializationException { try { final SSLContext sslcontext = SSLContext.getInstance(SSLContextBuilder.TLS); sslcontext.init(null, null, null); return sslcontext; } catch (final NoSuchAlgorithmException ex) { throw new SSLInitializationException(ex.getMessage(), ex); } catch (final KeyManagementException ex) { throw new SSLInitializationException(ex.getMessage(), ex); } }
/** * Creates default factory based on the standard JSSE trust material * ({@code cacerts} file in the security properties directory). System properties * are not taken into consideration. * * @return the default SSL socket factory */ public static SSLContext createDefault() throws SSLInitializationException { try { final SSLContext sslcontext = SSLContext.getInstance(SSLContextBuilder.TLS); sslcontext.init(null, null, null); return sslcontext; } catch (final NoSuchAlgorithmException ex) { throw new SSLInitializationException(ex.getMessage(), ex); } catch (final KeyManagementException ex) { throw new SSLInitializationException(ex.getMessage(), ex); } }
/** * Creates default factory based on the standard JSSE trust material * ({@code cacerts} file in the security properties directory). System properties * are not taken into consideration. * * @return the default SSL socket factory */ public static SSLContext createDefault() throws SSLInitializationException { try { final SSLContext sslcontext = SSLContext.getInstance(SSLContextBuilder.TLS); sslcontext.init(null, null, null); return sslcontext; } catch (final NoSuchAlgorithmException ex) { throw new SSLInitializationException(ex.getMessage(), ex); } catch (final KeyManagementException ex) { throw new SSLInitializationException(ex.getMessage(), ex); } }
/** * Creates default factory based on the standard JSSE trust material * ({@code cacerts} file in the security properties directory). System properties * are not taken into consideration. * * @return the default SSL socket factory */ public static SSLContext createDefault() throws SSLInitializationException { try { final SSLContext sslcontext = SSLContext.getInstance(SSLContextBuilder.TLS); sslcontext.init(null, null, null); return sslcontext; } catch (final NoSuchAlgorithmException ex) { throw new SSLInitializationException(ex.getMessage(), ex); } catch (final KeyManagementException ex) { throw new SSLInitializationException(ex.getMessage(), ex); } }
throw new SSLInitializationException(ex.getMessage(), ex); } catch (final KeyManagementException ex) { throw new SSLInitializationException(ex.getMessage(), ex);
private SSLContext getSslContext(AttributeMap standardOptions) { TrustManager[] trustManagers = null; if (standardOptions.get(SdkHttpConfigurationOption.TRUST_ALL_CERTIFICATES)) { log.warn(() -> "SSL Certificate verification is disabled. This is not a safe setting and should only be " + "used for testing."); trustManagers = trustAllTrustManager(); } try { SSLContext sslcontext = SSLContext.getInstance("TLS"); // http://download.java.net/jdk9/docs/technotes/guides/security/jsse/JSSERefGuide.html sslcontext.init(null, trustManagers, null); return sslcontext; } catch (final NoSuchAlgorithmException | KeyManagementException ex) { throw new SSLInitializationException(ex.getMessage(), ex); } }
throw new SSLInitializationException( ex.getMessage(), ex );
throw new SSLInitializationException( ex.getMessage(), ex );
socketFactoryRegistryBuilder.register("https", sslConnectionSocketFactory); } catch (NoSuchAlgorithmException e1) { throw new SSLInitializationException(e1.getMessage(), e1); } catch (KeyManagementException e2) { throw new SSLInitializationException(e2.getMessage(), e2);