Package io.lettuce.core
Class SslOptions
- java.lang.Object
-
- io.lettuce.core.SslOptions
-
public class SslOptions extends Object
Options to configure SSL options for the connections kept to Redis servers.- Since:
- 4.3
- Author:
- Mark Paluch, Amin Mohtashami, Felipe Ruiz
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SslOptions.Builder
Builder forSslOptions
.static interface
SslOptions.Resource
Supplier for aInputStream
representing a resource.
-
Field Summary
Fields Modifier and Type Field Description static SslProvider
DEFAULT_SSL_PROVIDER
-
Constructor Summary
Constructors Modifier Constructor Description protected
SslOptions(SslOptions original)
protected
SslOptions(SslOptions.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static SslOptions.Builder
builder()
Returns a newSslOptions.Builder
to constructSslOptions
.static SslOptions
copyOf(SslOptions options)
Create a copy of optionsstatic SslOptions
create()
Create a newSslOptions
using default settings.SslContextBuilder
createSslContextBuilder()
Creates a newSslContextBuilder
object that is pre-configured with values from thisSslOptions
object.SSLParameters
createSSLParameters()
Creates aSSLParameters
object that is pre-configured with values from thisSslOptions
object.String[]
getCipherSuites()
Duration
getHandshakeTimeout()
URL
getKeystore()
Deprecated.since 5.3,KeyManager
is configured viacreateSslContextBuilder()
.char[]
getKeystorePassword()
Deprecated.since 5.3,KeyManager
is configured viacreateSslContextBuilder()
.String[]
getProtocols()
SslProvider
getSslProvider()
Deprecated.URL
getTruststore()
Deprecated.since 5.3,TrustManager
is configured viacreateSslContextBuilder()
.char[]
getTruststorePassword()
Deprecated.since 5.3,TrustManager
is configured viacreateSslContextBuilder()
.SslOptions.Builder
mutate()
Returns a builder to create newSslOptions
whose settings are replicated from the currentSslOptions
.
-
-
-
Field Detail
-
DEFAULT_SSL_PROVIDER
public static final SslProvider DEFAULT_SSL_PROVIDER
-
-
Constructor Detail
-
SslOptions
protected SslOptions(SslOptions.Builder builder)
-
SslOptions
protected SslOptions(SslOptions original)
-
-
Method Detail
-
copyOf
public static SslOptions copyOf(SslOptions options)
Create a copy of options- Parameters:
options
- the original- Returns:
- A new instance of
SslOptions
containing the values of options
-
builder
public static SslOptions.Builder builder()
Returns a newSslOptions.Builder
to constructSslOptions
.- Returns:
- a new
SslOptions.Builder
to constructSslOptions
.
-
create
public static SslOptions create()
Create a newSslOptions
using default settings.- Returns:
- a new instance of default cluster client client options.
-
createSslContextBuilder
public SslContextBuilder createSslContextBuilder() throws IOException, GeneralSecurityException
Creates a newSslContextBuilder
object that is pre-configured with values from thisSslOptions
object.- Returns:
- a new
SslContextBuilder
. - Throws:
IOException
- thrown when loading the keystore or the truststore fails.GeneralSecurityException
- thrown when loading the keystore or the truststore fails.- Since:
- 5.3
-
createSSLParameters
public SSLParameters createSSLParameters()
Creates aSSLParameters
object that is pre-configured with values from thisSslOptions
object.- Returns:
- a new a
SSLParameters
object. - Since:
- 5.3
-
mutate
public SslOptions.Builder mutate()
Returns a builder to create newSslOptions
whose settings are replicated from the currentSslOptions
.- Returns:
- a
SslOptions.Builder
to create newSslOptions
whose settings are replicated from the currentSslOptions
- Since:
- 5.3
-
getSslProvider
@Deprecated public SslProvider getSslProvider()
Deprecated.- Returns:
- the configured
SslProvider
.
-
getKeystore
@Deprecated public URL getKeystore()
Deprecated.since 5.3,KeyManager
is configured viacreateSslContextBuilder()
.- Returns:
- the keystore
URL
.
-
getProtocols
public String[] getProtocols()
- Returns:
- the set of protocols
-
getCipherSuites
public String[] getCipherSuites()
- Returns:
- the set of cipher suites
-
getHandshakeTimeout
public Duration getHandshakeTimeout()
- Returns:
- the SSL handshake timeout
- Since:
- 5.3.2
-
getKeystorePassword
@Deprecated public char[] getKeystorePassword()
Deprecated.since 5.3,KeyManager
is configured viacreateSslContextBuilder()
.- Returns:
- the password for the keystore. May be empty.
-
getTruststore
@Deprecated public URL getTruststore()
Deprecated.since 5.3,TrustManager
is configured viacreateSslContextBuilder()
.- Returns:
- the truststore
URL
.
-
getTruststorePassword
@Deprecated public char[] getTruststorePassword()
Deprecated.since 5.3,TrustManager
is configured viacreateSslContextBuilder()
.- Returns:
- the password for the truststore. May be empty.
-
-