public final class TlsPolicy extends Object
| Modifier and Type | Field and Description |
|---|---|
String[] |
ciphers
Allowable TLS ciphers that the client can use for secure connections.
|
SSLContext |
context
Optional SSLContext configuration instead using default SSLContext.
|
boolean |
forLoginOnly
Use TLS connections only for login authentication.
|
NettyTlsContext |
nettyContext
Optional NettyTlsContext configuration.
|
String[] |
protocols
Allowable TLS protocols that the client can use for secure connections.
|
BigInteger[] |
revokeCertificates
Reject certificates whose serial numbers match a serial number in this array.
|
| Constructor and Description |
|---|
TlsPolicy()
Default constructor.
|
TlsPolicy(TlsPolicy other)
Copy TLS policy from another TLS policy.
|
| Modifier and Type | Method and Description |
|---|---|
void |
setCiphers(String[] ciphers) |
void |
setContext(SSLContext context) |
void |
setForLoginOnly(boolean forLoginOnly) |
void |
setNettyContext(NettyTlsContext nettyContext) |
void |
setProtocols(String[] protocols) |
void |
setRevokeCertificates(BigInteger[] revokeCertificates) |
public SSLContext context
Default: null (use default SSLContext).
public NettyTlsContext nettyContext
// 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);
Default: null (create NettyTlsContext for each AerospikeClient instance when netty is used).public String[] protocols
SSLSocket.getSupportedProtocols()
Multiple protocols can be specified. Example:
TlsPolicy policy = new TlsPolicy();
policy.protocols = new String[] {"TLSv1", "TLSv1.1", "TLSv1.2"};
Default: TLSv1.2 (Only allow TLSv1.2 protocol)public String[] ciphers
SSLSocket.getSupportedCipherSuites()
Multiple ciphers can be specified.
Default: null (Allow default ciphers defined by JVM)
public BigInteger[] revokeCertificates
Default: null (Do not exclude by certificate serial number)
public boolean forLoginOnly
Default: false (Use TLS connections for all communication with server.)
public TlsPolicy(TlsPolicy other)
public TlsPolicy()
public void setContext(SSLContext context)
public void setNettyContext(NettyTlsContext nettyContext)
public void setProtocols(String[] protocols)
public void setCiphers(String[] ciphers)
public void setRevokeCertificates(BigInteger[] revokeCertificates)
public void setForLoginOnly(boolean forLoginOnly)
Copyright © 2012–2024 Aerospike, Inc. All rights reserved.