Package io.muserver
Class SSLContextBuilder
- java.lang.Object
-
- io.muserver.SSLContextBuilder
-
- Direct Known Subclasses:
HttpsConfigBuilder
@Deprecated public class SSLContextBuilder extends java.lang.Object
Deprecated.UseHttpsConfigBuilder
instead
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.net.ssl.TrustManager
trustManager
Deprecated.Only used by HttpsConfigBuilder
-
Constructor Summary
Constructors Constructor Description SSLContextBuilder()
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description javax.net.ssl.SSLContext
build()
Deprecated.Pass this builder itself to the HttpsConfig rather than building an SSLContextstatic javax.net.ssl.SSLContext
defaultSSLContext()
Deprecated.protected void
setKeystoreBytes(java.io.InputStream is, boolean closeAfter)
Deprecated.Sets the keystore to usestatic SSLContextBuilder
sslContext()
Deprecated.static javax.net.ssl.SSLContext
unsignedLocalhostCert()
Deprecated.UseHttpsConfigBuilder.unsignedLocalhost()
insteadstatic SSLContextBuilder
unsignedLocalhostCertBuilder()
Deprecated.UseHttpsConfigBuilder.unsignedLocalhost()
insteadSSLContextBuilder
withCipherFilter(SSLCipherFilter cipherFilter)
Deprecated.Sets a filter allowing you to specify which ciphers you would like to support.SSLContextBuilder
withDefaultAlias(java.lang.String certAlias)
Deprecated.This option may be useful for cases where multiple certificates exist in a single keystore.SSLContextBuilder
withKeyManagerFactory(javax.net.ssl.KeyManagerFactory keyManagerFactory)
Deprecated.Sets the key manager factory to use for SSL.SSLContextBuilder
withKeyPassword(char[] keyPassword)
Deprecated.The password to use to get the key from the keystoreSSLContextBuilder
withKeyPassword(java.lang.String keyPassword)
Deprecated.The password to use to get the key from the keystoreSSLContextBuilder
withKeystore(java.io.File file)
Deprecated.Specifies the keystore to useSSLContextBuilder
withKeystore(java.io.InputStream keystoreStream)
Deprecated.Loads a keystore from the given stream.SSLContextBuilder
withKeystoreFromClasspath(java.lang.String classpath)
Deprecated.Loads a keystore from the classpathSSLContextBuilder
withKeystorePassword(char[] keystorePassword)
Deprecated.The password to use to access the keystoreSSLContextBuilder
withKeystorePassword(java.lang.String keystorePassword)
Deprecated.The password to use to access the keystoreSSLContextBuilder
withKeystoreType(java.lang.String keystoreType)
Deprecated.The type of keystore, such as JKS, JCEKS, PKCS12, etcSSLContextBuilder
withProtocols(java.lang.String... protocols)
Deprecated.Sets the SSL/TLS protocols to use, for example "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3".
-
-
-
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 keystorecloseAfter
- 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
-
sslContext
@Deprecated public static SSLContextBuilder sslContext()
Deprecated.UseHttpsConfigBuilder.httpsConfig()
instead- Returns:
- This builder
-
defaultSSLContext
@Deprecated public static javax.net.ssl.SSLContext defaultSSLContext()
Deprecated.- Returns:
- The JDK's default SSL context
-
unsignedLocalhostCert
@Deprecated public static javax.net.ssl.SSLContext unsignedLocalhostCert()
Deprecated.UseHttpsConfigBuilder.unsignedLocalhost()
instead- Returns:
- An SSLContext
-
unsignedLocalhostCertBuilder
@Deprecated public static SSLContextBuilder unsignedLocalhostCertBuilder()
Deprecated.UseHttpsConfigBuilder.unsignedLocalhost()
instead- Returns:
- A builder
-
-