Class SslConfiguration

    • Field Detail

      • PREFIX

        public static final java.lang.String PREFIX
        The prefix used to resolve this configuration.
        See Also:
        Constant Field Values
      • DEFAULT_ENABLED

        public static final boolean DEFAULT_ENABLED
        The default enable value.
        See Also:
        Constant Field Values
      • DEFAULT_PORT

        public static final int DEFAULT_PORT
        The default port value.
        See Also:
        Constant Field Values
      • DEFAULT_BUILDSELFSIGNED

        public static final boolean DEFAULT_BUILDSELFSIGNED
        The default build self signed value.
        See Also:
        Constant Field Values
      • DEFAULT_PROTOCOL

        public static final java.lang.String DEFAULT_PROTOCOL
        The default protocol.
        See Also:
        Constant Field Values
      • port

        protected int port
      • buildSelfSigned

        protected boolean buildSelfSigned
    • Constructor Detail

      • SslConfiguration

        public SslConfiguration()
    • Method Detail

      • isEnabled

        public boolean isEnabled()
        Specified by:
        isEnabled in interface io.micronaut.core.util.Toggleable
        Returns:
        Whether SSL is enabled.
      • setEnabled

        public void setEnabled​(boolean enabled)
        Whether SSL is enabled. Default value (false).
        Parameters:
        enabled - True if SSL is enabled
      • getPort

        public int getPort()
        Returns:
        The default SSL port
      • buildSelfSigned

        public boolean buildSelfSigned()
        Returns:
        Whether or not to build a self signed certificate
      • getClientAuthentication

        public java.util.Optional<ClientAuthentication> getClientAuthentication()
        Returns:
        The type of client authentication
      • getCiphers

        public java.util.Optional<java.lang.String[]> getCiphers()
        Returns:
        Which SSL ciphers to use
      • getProtocols

        public java.util.Optional<java.lang.String[]> getProtocols()
        Returns:
        Which protocols to use
      • getProtocol

        public java.util.Optional<java.lang.String> getProtocol()
        Returns:
        The protocol to use
      • getHandshakeTimeout

        @NonNull
        public java.time.Duration getHandshakeTimeout()
        Returns:
        The timeout for the SSL handshake
      • setPort

        @Deprecated
        public void setPort​(int port)
        Deprecated.
        Please use micronaut.server.ssl.port instead (ServerSslConfiguration.setPort(int)).
        Sets the SSL port. Default value (8443).
        Parameters:
        port - The port
      • setBuildSelfSigned

        @Deprecated
        public void setBuildSelfSigned​(boolean buildSelfSigned)
        Deprecated.
        Please use micronaut.server.ssl.build-self-signed instead (buildSelfSigned()).
        Sets whether to build a self signed certificate. Default value (false).
        Parameters:
        buildSelfSigned - True if a certificate should be built
      • setClientAuthentication

        public void setClientAuthentication​(ClientAuthentication clientAuthentication)
        Sets the client authentication mode.
        Parameters:
        clientAuthentication - The client authentication mode
      • setCiphers

        public void setCiphers​(java.lang.String[] ciphers)
        Sets the ciphers to use.
        Parameters:
        ciphers - The ciphers
      • setProtocols

        public void setProtocols​(java.lang.String[] protocols)
        Sets the protocols to use.
        Parameters:
        protocols - The protocols
      • setProtocol

        public void setProtocol​(java.lang.String protocol)
        Sets the protocol to use. Default value ("TLS").
        Parameters:
        protocol - The protocol
      • setHandshakeTimeout

        public void setHandshakeTimeout​(@NonNull
                                        java.time.Duration handshakeTimeout)
        Parameters:
        handshakeTimeout - The timeout for the SSL handshake