Package io.muserver

Class SSLContextBuilder

    • Field Detail

      • trustManager

        protected javax.net.ssl.TrustManager trustManager
        Deprecated.
        Only used by HttpsConfigBuilder
    • Constructor Detail

      • SSLContextBuilder

        public SSLContextBuilder()
        Deprecated.
    • Method Detail

      • withKeystoreType

        public SSLContextBuilder withKeystoreType​(java.lang.String keystoreType)
        Deprecated.
        The type of keystore, such as JKS, JCEKS, PKCS12, etc
        Parameters:
        keystoreType - The type of keystore to load
        Returns:
        This builder
      • withKeyPassword

        public SSLContextBuilder withKeyPassword​(java.lang.String keyPassword)
        Deprecated.
        The password to use to get the key from the keystore
        Parameters:
        keyPassword - The password
        Returns:
        This builder
      • withKeystorePassword

        public SSLContextBuilder withKeystorePassword​(java.lang.String keystorePassword)
        Deprecated.
        The password to use to access the keystore
        Parameters:
        keystorePassword - The password
        Returns:
        This builder
      • withKeyPassword

        public SSLContextBuilder withKeyPassword​(char[] keyPassword)
        Deprecated.
        The password to use to get the key from the keystore
        Parameters:
        keyPassword - The password
        Returns:
        This builder
      • withKeystorePassword

        public SSLContextBuilder withKeystorePassword​(char[] keystorePassword)
        Deprecated.
        The password to use to access the keystore
        Parameters:
        keystorePassword - The password
        Returns:
        This builder
      • setKeystoreBytes

        protected void setKeystoreBytes​(java.io.InputStream is,
                                        boolean closeAfter)
        Deprecated.
        Sets the keystore to use
        Parameters:
        is - The input stream of the keystore
        closeAfter - Whether or not this method should close the stream
      • withKeystore

        public SSLContextBuilder withKeystore​(java.io.InputStream keystoreStream)
        Deprecated.
        Loads a keystore from the given stream.

        Does not close the keystore afterwards.

        Parameters:
        keystoreStream - A stream to a keystore
        Returns:
        This builder
      • withKeystore

        public SSLContextBuilder withKeystore​(java.io.File file)
        Deprecated.
        Specifies the keystore to use
        Parameters:
        file - A file object pointing to the keystore
        Returns:
        This builder
      • withKeystoreFromClasspath

        public SSLContextBuilder withKeystoreFromClasspath​(java.lang.String classpath)
        Deprecated.
        Loads a keystore from the classpath
        Parameters:
        classpath - A path to load a keystore from, for example /mycert.p12
        Returns:
        This builder
      • withKeyManagerFactory

        public SSLContextBuilder withKeyManagerFactory​(javax.net.ssl.KeyManagerFactory keyManagerFactory)
        Deprecated.
        Sets the key manager factory to use for SSL.

        Note this is an alternative to setting a keystore directory.

        Parameters:
        keyManagerFactory - The key manager factory to use
        Returns:
        This builder
      • withCipherFilter

        public SSLContextBuilder withCipherFilter​(SSLCipherFilter cipherFilter)
        Deprecated.
        Sets a filter allowing you to specify which ciphers you would like to support.
        Parameters:
        cipherFilter - A Filter that takes all the supported ciphers, and all the default ciphers (normally the default will exclude insecure ciphers that technically could be supported) and returns a list of ciphers you want to use in your preferred order.
        Returns:
        This builder
      • withProtocols

        public SSLContextBuilder withProtocols​(java.lang.String... protocols)
        Deprecated.
        Sets the SSL/TLS protocols to use, for example "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3". The default is "TLSv1.2" and "TLSv1.3".

        Note that if the current JDK does not support a requested protocol then it will be ignored. If no requested protocols are available, then an exception will be started when this is built.

        Parameters:
        protocols - The protocols to use, or null to use the default.
        Returns:
        This builder.
      • withDefaultAlias

        public SSLContextBuilder withDefaultAlias​(java.lang.String certAlias)
        Deprecated.
        This option may be useful for cases where multiple certificates exist in a single keystore. For clients that support it, SNI will be used to pick the correct certificate, however if the SNI is not used then by default the first cert from the keystore will be picked. To override this default behaviour, you can specify the certificate to use here when SNI is not available.

        Note you do not need to set this if your keystore has only one certificate in it.

        Parameters:
        certAlias - The alias of the cert to pick when SNI isn't available, or null to allow an arbitrary cert to be picked (normally the first one).
        Returns:
        This builder
      • build

        @Deprecated
        public javax.net.ssl.SSLContext build()
        Deprecated.
        Pass this builder itself to the HttpsConfig rather than building an SSLContext
        Returns:
        Creates an SSLContext
      • defaultSSLContext

        @Deprecated
        public static javax.net.ssl.SSLContext defaultSSLContext()
        Deprecated.
        Returns:
        The JDK's default SSL context