Package com.aerospike.client.policy
Class TlsPolicy
java.lang.Object
com.aerospike.client.policy.TlsPolicy
TLS connection policy. Secure TLS connections are supported for
synchronous commands and netty backed asynchronous commands.
-
Field Summary
FieldsModifier and TypeFieldDescriptionString[]
Allowable TLS ciphers that the client can use for secure connections.Optional SSLContext configuration instead using default SSLContext.boolean
Use TLS connections only for login authentication.Optional NettyTlsContext configuration.String[]
Allowable TLS protocols that the client can use for secure connections.Reject certificates whose serial numbers match a serial number in this array. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
setCiphers
(String[] ciphers) void
setContext
(SSLContext context) void
setForLoginOnly
(boolean forLoginOnly) void
setNettyContext
(NettyTlsContext nettyContext) void
setProtocols
(String[] protocols) void
setRevokeCertificates
(BigInteger[] revokeCertificates)
-
Field Details
-
context
Optional SSLContext configuration instead using default SSLContext.Default: null (use default SSLContext).
-
nettyContext
Optional NettyTlsContext configuration. This field is used when the same NettyTlsContext instance needs to be shared between multiple AerospikeClient instances. If this field is null, the AerospikeClient constructor will create a new NettyTlsContext when netty eventloops are used with TLS.
Default: null (create NettyTlsContext for each AerospikeClient instance when netty is used).// Share NettyTlsContext across AerospikeClient instances. TlsPolicy tp = new TlsPolicy(); tp.protocols = new String[] {"TLSv1", "TLSv1.1", "TLSv1.2"}; tp.nettyContext = new NettyTlsContext(tp); ClientPolicy cp = new ClientPolicy(); cp.tlsPolicy = tp; AerospikeClient cluster1 = new AerospikeClient(cp, "host1", 3000); AerospikeClient cluster2 = new AerospikeClient(cp, "host2", 3000);
-
protocols
Allowable TLS protocols that the client can use for secure connections. Available cipher names can be obtained bySSLSocket.getSupportedProtocols()
Multiple protocols can be specified. Example:TlsPolicy policy = new TlsPolicy(); policy.protocols = new String[] {"TLSv1", "TLSv1.1", "TLSv1.2"};
-
ciphers
Allowable TLS ciphers that the client can use for secure connections. Available cipher names can be obtained bySSLSocket.getSupportedCipherSuites()
Multiple ciphers can be specified.Default: null (Allow default ciphers defined by JVM)
-
revokeCertificates
Reject certificates whose serial numbers match a serial number in this array.Default: null (Do not exclude by certificate serial number)
-
forLoginOnly
public boolean forLoginOnlyUse TLS connections only for login authentication. All other communication with the server will be done with non-TLS connections.Default: false (Use TLS connections for all communication with server.)
-
-
Constructor Details
-
TlsPolicy
Copy TLS policy from another TLS policy. -
TlsPolicy
public TlsPolicy()Default constructor.
-
-
Method Details
-
setContext
-
setNettyContext
-
setProtocols
-
setCiphers
-
setRevokeCertificates
-
setForLoginOnly
public void setForLoginOnly(boolean forLoginOnly)
-