Class WebServerTls.Builder

    • Method Detail

      • config

        public WebServerTls.Builder config​(Config config)
        Update this builder from configuration.
        Parameters:
        config - config on the node of SSL configuration
        Returns:
        this builder
      • clientAuth

        public WebServerTls.Builder clientAuth​(ClientAuthentication clientAuth)
        Configures whether client authentication will be required or not.
        Parameters:
        clientAuth - client authentication
        Returns:
        this builder
      • sslContext

        public WebServerTls.Builder sslContext​(SSLContext context)
        Configures a SSLContext to use with the server socket. If not null then the server enforces an SSL communication.
        Parameters:
        context - a SSL context to use
        Returns:
        this builder
      • enabledProtocols

        public WebServerTls.Builder enabledProtocols​(String... protocols)
        Configures the TLS protocols to enable with the server socket.
        Parameters:
        protocols - protocols to enable, if empty, enables defaults
        Returns:
        this builder
        Throws:
        NullPointerException - in case the protocols is null
      • enabledProtocols

        public WebServerTls.Builder enabledProtocols​(Collection<String> protocols)
        Configures the TLS protocols to enable with the server socket.
        Parameters:
        protocols - protocols to enable, if empty enables the default protocols
        Returns:
        this builder
        Throws:
        NullPointerException - in case the protocols is null
      • privateKey

        public WebServerTls.Builder privateKey​(KeyConfig privateKeyConfig)
        Configure private key to use for SSL context.
        Parameters:
        privateKeyConfig - the required private key configuration parameter
        Returns:
        this builder
      • privateKey

        public WebServerTls.Builder privateKey​(Supplier<KeyConfig> privateKeyConfigBuilder)
        Configure private key to use for SSL context.
        Parameters:
        privateKeyConfigBuilder - the required private key configuration parameter
        Returns:
        this builder
      • trust

        public WebServerTls.Builder trust​(KeyConfig trustConfig)
        Set the trust key configuration to be used to validate certificates.
        Parameters:
        trustConfig - the trust configuration
        Returns:
        this builder
      • trust

        public WebServerTls.Builder trust​(Supplier<KeyConfig> trustConfigBuilder)
        Set the trust key configuration to be used to validate certificates.
        Parameters:
        trustConfigBuilder - the trust configuration builder
        Returns:
        this builder
      • sessionCacheSize

        public WebServerTls.Builder sessionCacheSize​(long sessionCacheSize)
        Set the size of the cache used for storing SSL session objects. 0 to use the default value.
        Parameters:
        sessionCacheSize - the session cache size
        Returns:
        this builder
      • sessionTimeoutSeconds

        public WebServerTls.Builder sessionTimeoutSeconds​(long sessionTimeout)
        Set the timeout for the cached SSL session objects, in seconds. 0 to use the default value.
        Parameters:
        sessionTimeout - the session timeout
        Returns:
        this builder
      • sessionTimeout

        public WebServerTls.Builder sessionTimeout​(long timeout,
                                                   TimeUnit unit)
        Set the timeout for the cached SSL session objects. 0 to use the default value.
        Parameters:
        timeout - the session timeout amount
        unit - the session timeout time unit
        Returns:
        this builder
      • allowedCipherSuite

        public WebServerTls.Builder allowedCipherSuite​(List<String> cipherSuite)
        Set allowed cipher suite. If an empty collection is set, an exception is thrown since it is required to support at least some ciphers.
        Parameters:
        cipherSuite - allowed cipher suite
        Returns:
        an updated builder
      • enabled

        public WebServerTls.Builder enabled​(boolean enabled)
        Whether the TLS config should be enabled or not.
        Parameters:
        enabled - configure to false to disable SSL context (and SSL support on the server)
        Returns:
        this builder