@Test public void testRESTClientSSLMissingTrustStore() throws Exception { Configuration config = new Configuration(); config.setBoolean(SecurityOptions.SSL_REST_ENABLED, true); config.setString(SecurityOptions.SSL_REST_TRUSTSTORE_PASSWORD, "some password"); try { SSLUtils.createRestClientSSLEngineFactory(config); fail("exception expected"); } catch (IllegalConfigurationException ignored) {} }
public static SSLHandlerFactory createRestClientSSLEngineFactory(final Configuration config) throws Exception { SSLContext sslContext = createRestClientSSLContext(config); if (sslContext == null) { throw new IllegalConfigurationException("SSL is not enabled for REST endpoints."); } return new SSLHandlerFactory( sslContext, getEnabledProtocols(config), getEnabledCipherSuites(config), true, isRestSSLAuthenticationEnabled(config), -1, -1); }
SSLUtils { public static SSLHandlerFactory createRestClientSSLEngineFactory(final Configuration config) throws Exception { SSLContext sslContext = createRestClientSSLContext(config); if (sslContext == null) { throw new IllegalConfigurationException("SSL is not enabled for REST endpoints."); } return new SSLHandlerFactory( sslContext, getEnabledProtocols(config), getEnabledCipherSuites(config), true, isRestSSLAuthenticationEnabled(config), -1, -1); } }
SSLUtils { public static SSLHandlerFactory createRestClientSSLEngineFactory(final Configuration config) throws Exception { SSLContext sslContext = createRestClientSSLContext(config); if (sslContext == null) { throw new IllegalConfigurationException("SSL is not enabled for REST endpoints."); } return new SSLHandlerFactory( sslContext, getEnabledProtocols(config), getEnabledCipherSuites(config), true, isRestSSLAuthenticationEnabled(config), -1, -1); }  }
SSLUtils { public static SSLHandlerFactory createRestClientSSLEngineFactory(final Configuration config) throws Exception { SSLContext sslContext = createRestClientSSLContext(config); if (sslContext == null) { throw new IllegalConfigurationException("SSL is not enabled for REST endpoints."); } return new SSLHandlerFactory( sslContext, getEnabledProtocols(config), getEnabledCipherSuites(config), true, isRestSSLAuthenticationEnabled(config), -1, -1); }  static boolean isInternalSSLEnabled(Configuration sslConfig); static boolean isRestSSLEnabled(Configuration sslConfig); static boolean isRestSSLAuthenticationEnabled(Configuration sslConfig); static ServerSocketFactory createSSLServerSocketFactory(Configuration config); static SocketFactory createSSLClientSocketFactory(Configuration config); static SSLHandlerFactory createInternalServerSSLEngineFactory(final Configuration config); static SSLHandlerFactory createInternalClientSSLEngineFactory(final Configuration config); static SSLHandlerFactory createRestServerSSLEngineFactory(final Configuration config); static SSLHandlerFactory createRestClientSSLEngineFactory(final Configuration config); @Nullable static SSLContext createRestServerSSLContext(Configuration config); @Nullable static SSLContext createRestClientSSLContext(Configuration config); }
SSLUtils { public static SSLHandlerFactory createRestClientSSLEngineFactory(final Configuration config) throws Exception { SSLContext sslContext = createRestClientSSLContext(config); if (sslContext == null) { throw new IllegalConfigurationException("SSL is not enabled for REST endpoints."); } return new SSLHandlerFactory( sslContext, getEnabledProtocols(config), getEnabledCipherSuites(config), true, isRestSSLAuthenticationEnabled(config), -1, -1); }  static boolean isInternalSSLEnabled(Configuration sslConfig); static boolean isRestSSLEnabled(Configuration sslConfig); static boolean isRestSSLAuthenticationEnabled(Configuration sslConfig); static ServerSocketFactory createSSLServerSocketFactory(Configuration config); static SocketFactory createSSLClientSocketFactory(Configuration config); static SSLHandlerFactory createInternalServerSSLEngineFactory(final Configuration config); static SSLHandlerFactory createInternalClientSSLEngineFactory(final Configuration config); static SSLHandlerFactory createRestServerSSLEngineFactory(final Configuration config); static SSLHandlerFactory createRestClientSSLEngineFactory(final Configuration config); @Nullable static SSLContext createRestServerSSLContext(Configuration config); @Nullable static SSLContext createRestClientSSLContext(Configuration config);  }