/** * Adds a {@link HostnameVerifyingTrustManager} to the supplied config if no trust managers have been configured. A * {@link DefaultTrustManager} is also added in no {@link CredentialConfig} has been configured. * * @deprecated {@link HostnameVerifierConfig} should be used for hostname verification * * @param config to modify * @param names of the hosts to verify */ @Deprecated protected static void addHostnameVerifyingTrustManager(final SslConfig config, final String[] names) { if (config.getTrustManagers() == null) { if (config.getCredentialConfig() == null) { config.setTrustManagers( new DefaultTrustManager(), new HostnameVerifyingTrustManager(new DefaultHostnameVerifier(), names)); } else { config.setTrustManagers(new HostnameVerifyingTrustManager(new DefaultHostnameVerifier(), names)); } } }
/** * Adds a {@link HostnameVerifyingTrustManager} to the supplied config if no trust managers have been configured. A * {@link DefaultTrustManager} is also added in no {@link CredentialConfig} has been configured. * * @deprecated {@link HostnameVerifierConfig} should be used for hostname verification * * @param config to modify * @param names of the hosts to verify */ @Deprecated protected static void addHostnameVerifyingTrustManager(final SslConfig config, final String[] names) { if (config.getTrustManagers() == null) { if (config.getCredentialConfig() == null) { config.setTrustManagers( new DefaultTrustManager(), new HostnameVerifyingTrustManager(new DefaultHostnameVerifier(), names)); } else { config.setTrustManagers(new HostnameVerifyingTrustManager(new DefaultHostnameVerifier(), names)); } } }
/** * Adds a {@link HostnameVerifyingTrustManager} to the supplied config if no trust managers have been configured. A * {@link DefaultTrustManager} is also added in no {@link CredentialConfig} has been configured. * * @param config to modify * @param names of the hosts to verify */ protected static void addHostnameVerifyingTrustManager(final SslConfig config, final String[] names) { if (config.getTrustManagers() == null) { if (config.getCredentialConfig() == null) { config.setTrustManagers( new DefaultTrustManager(), new HostnameVerifyingTrustManager(new DefaultHostnameVerifier(), names)); } else { config.setTrustManagers(new HostnameVerifyingTrustManager(new DefaultHostnameVerifier(), names)); } } }
/** * Returns a ssl config initialized with the supplied config. * * @param config ssl config to read properties from * * @return ssl config */ public static SslConfig newSslConfig(final SslConfig config) { final SslConfig sc = new SslConfig(); sc.setCredentialConfig(config.getCredentialConfig()); sc.setTrustManagers(config.getTrustManagers()); sc.setEnabledCipherSuites(config.getEnabledCipherSuites()); sc.setEnabledProtocols(config.getEnabledProtocols()); sc.setHandshakeCompletedListeners(config.getHandshakeCompletedListeners()); return sc; }
/** * Returns a ssl config initialized with the supplied config. * * @param config ssl config to read properties from * * @return ssl config */ public static SslConfig newSslConfig(final SslConfig config) { final SslConfig sc = new SslConfig(); sc.setCredentialConfig(config.getCredentialConfig()); sc.setTrustManagers(config.getTrustManagers()); sc.setHostnameVerifier(config.getHostnameVerifier()); sc.setHostnameVerifierConfig(config.getHostnameVerifierConfig()); sc.setEnabledCipherSuites(config.getEnabledCipherSuites()); sc.setEnabledProtocols(config.getEnabledProtocols()); sc.setHandshakeCompletedListeners(config.getHandshakeCompletedListeners()); return sc; }
/** * Returns a ssl config initialized with the supplied config. * * @param config ssl config to read properties from * * @return ssl config */ public static SslConfig newSslConfig(final SslConfig config) { final SslConfig sc = new SslConfig(); sc.setCredentialConfig(config.getCredentialConfig()); sc.setTrustManagers(config.getTrustManagers()); sc.setHostnameVerifier(config.getHostnameVerifier()); sc.setHostnameVerifierConfig(config.getHostnameVerifierConfig()); sc.setEnabledCipherSuites(config.getEnabledCipherSuites()); sc.setEnabledProtocols(config.getEnabledProtocols()); sc.setHandshakeCompletedListeners(config.getHandshakeCompletedListeners()); return sc; }