/** * Gets the server's SSL configuration. * @return SSL configuration; if no SSL configuration was provided * a default configuration is returned */ public SSLConfiguration getSsl() { if (ssl == null) { ssl = new SSLConfiguration(); } return ssl; }
/** * Creates a new server using a custom SSL context. * @param lc logger context for received events * @param port port on which the server is to listen * @param sslContext custom SSL context */ public SimpleSSLSocketServer(LoggerContext lc, int port, SSLContext sslContext) { super(lc, port); if (sslContext == null) { throw new NullPointerException("SSL context required"); } SSLParametersConfiguration parameters = new SSLParametersConfiguration(); parameters.setContext(lc); this.socketFactory = new ConfigurableSSLServerSocketFactory(parameters, sslContext.getServerSocketFactory()); }
/** * {@inheritDoc} */ @Override protected ServerSocketFactory getServerSocketFactory() throws Exception { if (socketFactory == null) { SSLContext sslContext = getSsl().createContext(this); SSLParametersConfiguration parameters = getSsl().getParameters(); parameters.setContext(getContext()); socketFactory = new ConfigurableSSLServerSocketFactory(parameters, sslContext.getServerSocketFactory()); } return socketFactory; }
/** * {@inheritDoc} */ @Override protected boolean shouldStart() { try { SSLContext sslContext = getSsl().createContext(this); SSLParametersConfiguration parameters = getSsl().getParameters(); parameters.setContext(getContext()); socketFactory = new ConfigurableSSLSocketFactory(parameters, sslContext.getSocketFactory()); return super.shouldStart(); } catch (Exception ex) { addError(ex.getMessage(), ex); return false; } }
/** * {@inheritDoc} */ @Override public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException { SSLSocket socket = (SSLSocket) delegate.createSocket(address, port, localAddress, localPort); parameters.configure(new SSLConfigurableSocket(socket)); return socket; }
/** * {@inheritDoc} */ @Override public ServerSocket createServerSocket(int port, int backlog) throws IOException { SSLServerSocket socket = (SSLServerSocket) delegate.createServerSocket( port, backlog); parameters.configure(new SSLConfigurableServerSocket(socket)); return socket; }
/** * Gets the key store configuration. * @return key store factory bean or {@code null} if no key store * configuration was provided */ public KeyStoreFactoryBean getKeyStore() { if (keyStore == null) { keyStore = keyStoreFromSystemProperties(JSSE_KEY_STORE_PROPERTY); } return keyStore; }
/** * Gets the SSL parameters configuration. * @return parameters configuration; if no parameters object was * configured, a default parameters object is returned */ public SSLParametersConfiguration getParameters() { if (parameters == null) { parameters = new SSLParametersConfiguration(); } return parameters; }
static public void addDefaultNestedComponentRegistryRules(DefaultNestedComponentRegistry registry) { registry.add(AppenderBase.class, "layout", PatternLayout.class); registry.add(UnsynchronizedAppenderBase.class, "layout", PatternLayout.class); registry.add(AppenderBase.class, "encoder", PatternLayoutEncoder.class); registry.add(UnsynchronizedAppenderBase.class, "encoder", PatternLayoutEncoder.class); registry.add(EvaluatorFilter.class, "evaluator", JaninoEventEvaluator.class); SSLNestedComponentRegistryRules.addDefaultNestedComponentRegistryRules(registry); }
/** * Gets the trust manager factory configuration. * @return factory bean; if no trust manager factory * configuration has been set, a default factory bean is returned */ public TrustManagerFactoryFactoryBean getTrustManagerFactory() { if (trustManagerFactory == null) { return new TrustManagerFactoryFactoryBean(); } return trustManagerFactory; }
/** * Gets the secure random generator configuration. * @return secure random factory bean; if no secure random generator * configuration has been set, a default factory bean is returned */ public SecureRandomFactoryBean getSecureRandom() { if (secureRandom == null) { return new SecureRandomFactoryBean(); } return secureRandom; }
/** * Gets the key manager factory configuration. * @return factory bean; if no key manager factory * configuration has been set, a default factory bean is returned */ public KeyManagerFactoryFactoryBean getKeyManagerFactory() { if (keyManagerFactory == null) { return new KeyManagerFactoryFactoryBean(); } return keyManagerFactory; }
/** * {@inheritDoc} */ @Override public Socket createSocket(InetAddress host, int port) throws IOException { SSLSocket socket = (SSLSocket) delegate.createSocket(host, port); parameters.configure(new SSLConfigurableSocket(socket)); return socket; }
/** * {@inheritDoc} */ @Override public ServerSocket createServerSocket(int port, int backlog, InetAddress ifAddress) throws IOException { SSLServerSocket socket = (SSLServerSocket) delegate.createServerSocket( port, backlog, ifAddress); parameters.configure(new SSLConfigurableServerSocket(socket)); return socket; }
/** * Gets the SSL configuration. * @return SSL configuration; if no configuration has been set, a * default configuration is returned */ public SSLConfiguration getSsl() { if (ssl == null) { ssl = new SSLConfiguration(); } return ssl; }
/** * Gets the trust store configuration. * @return trust store factory bean or {@code null} if no trust store * configuration was provided */ public KeyStoreFactoryBean getTrustStore() { if (trustStore == null) { trustStore = keyStoreFromSystemProperties(JSSE_TRUST_STORE_PROPERTY); } return trustStore; }
/** * Gets the SSL configuration. * @return SSL configuration; if no configuration has been set, a * default configuration is returned */ public SSLConfiguration getSsl() { if (ssl == null) { ssl = new SSLConfiguration(); } return ssl; }
/** * Gets the server's SSL configuration. * @return SSL configuration; if no SSL configuration was provided * a default configuration is returned */ public SSLConfiguration getSsl() { if (ssl == null) { ssl = new SSLConfiguration(); } return ssl; }
/** * Gets the SSL configuration. * @return SSL configuration; if no configuration has been set, a * default configuration is returned */ public SSLConfiguration getSsl() { if (ssl == null) { ssl = new SSLConfiguration(); } return ssl; }
/** * Gets the SSL configuration. * @return SSL configuration; if no configuration has been set, a * default configuration is returned */ public SSLConfiguration getSsl() { if (ssl == null) { ssl = new SSLConfiguration(); } return ssl; }