Skip to content

Advanced TLS configuration

This guide covers advanced TLS configuration including cipher suite selection, naming conventions, and troubleshooting.

Cipher suite selection

Cipher suites determine the encryption algorithms used for TLS connections. Choose suites based on your security requirements and performance needs.

Security LevelCipher SuitesUse Case
HighTLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256Financial, healthcare
StandardTLS_AES_128_GCM_SHA256General production
CompatibleInclude TLS_ECDHE_RSA_*Legacy client support

OpenSSL vs IANA naming

Aerospike server uses OpenSSL naming, while Java clients use IANA (RFC) naming. Use this mapping table:

IANA Name (Java)OpenSSL Name (Server)TLS Version
TLS_AES_256_GCM_SHA384TLS_AES_256_GCM_SHA3841.3
TLS_AES_128_GCM_SHA256TLS_AES_128_GCM_SHA2561.3
TLS_CHACHA20_POLY1305_SHA256TLS_CHACHA20_POLY1305_SHA2561.3
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384ECDHE-RSA-AES256-GCM-SHA3841.2
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256ECDHE-RSA-AES128-GCM-SHA2561.2
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384ECDHE-ECDSA-AES256-GCM-SHA3841.2
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256ECDHE-ECDSA-AES128-GCM-SHA2561.2

Server-side cipher configuration

Configure allowed ciphers in aerospike.conf:

network {
tls tls-name {
cert-file /etc/aerospike/certs/server.crt
key-file /etc/aerospike/certs/server.key
ca-file /etc/aerospike/certs/ca.crt
# TLS 1.3 ciphers (recommended)
cipher-suite TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256
# Or TLS 1.2 ciphers (OpenSSL naming)
# cipher-suite ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256
# Minimum protocol version
protocols TLSv1.2 TLSv1.3
}
}

Client-side cipher configuration

import com.aerospike.client.sdk.Cluster;
import com.aerospike.client.sdk.ClusterDefinition;
import javax.net.ssl.SSLContext;
// Create SSL context with specific ciphers
SSLContext sslContext = SSLContext.getInstance("TLSv1.3");
sslContext.init(keyManagers, trustManagers, null);
// Configure cluster with TLS
try (Cluster cluster = new ClusterDefinition("secure.aerospike.example.com", 4333)
.withTlsConfigOf()
.tlsName("aerospike-server")
.customSslContext(sslContext)
.protocols("TLSv1.3", "TLSv1.2")
.ciphers(
"TLS_AES_256_GCM_SHA384",
"TLS_AES_128_GCM_SHA256",
"TLS_CHACHA20_POLY1305_SHA256"
)
.done()
.connect()) {
// Use cluster / session here
}

Using a custom SSLContext

import com.aerospike.client.sdk.Cluster;
import com.aerospike.client.sdk.ClusterDefinition;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManagerFactory;
import java.io.FileInputStream;
import java.io.InputStream;
import java.security.KeyStore;
KeyStore trustStore = KeyStore.getInstance("PKCS12");
try (InputStream in = new FileInputStream("/path/to/truststore.p12")) {
trustStore.load(in, "password".toCharArray());
}
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
tmf.init(trustStore);
SSLContext customSslContext = SSLContext.getInstance("TLSv1.3");
customSslContext.init(null, tmf.getTrustManagers(), null);
try (Cluster cluster = new ClusterDefinition("secure.aerospike.example.com", 4333)
.withTlsConfigOf()
.tlsName("aerospike-server")
.customSslContext(customSslContext)
.done()
.connect()) {
// Use cluster / session here
}

Troubleshooting TLS handshake issues

Common error messages

ErrorLikely CauseSolution
handshake_failureNo common cipher suiteCheck cipher configuration on both sides
certificate_unknownCA not trustedVerify CA certificate path
certificate_expiredCert past validityRenew certificate
bad_certificateCert/key mismatchRegenerate cert with correct key

Debugging with Java

Enable TLS debugging to see handshake details:

Terminal window
# Full TLS debugging
java -Djavax.net.debug=ssl:handshake -jar your-app.jar
# Only handshake messages
java -Djavax.net.debug=ssl:handshake:verbose -jar your-app.jar
# Only cipher negotiation
java -Djavax.net.debug=ssl:handshake:ciphersuites -jar your-app.jar

Sample debug output for cipher negotiation:

javax.net.ssl|DEBUG|...ClientHello, TLSv1.3
...
Cipher Suites: [TLS_AES_256_GCM_SHA384, TLS_AES_128_GCM_SHA256, ...]
...
javax.net.ssl|DEBUG|...ServerHello, TLSv1.3
...
Cipher Suite: TLS_AES_256_GCM_SHA384

Debugging with Python

import logging
# Enable SSL debugging
logging.basicConfig(level=logging.DEBUG)
logging.getLogger('ssl').setLevel(logging.DEBUG)
# Or use OpenSSL directly
import subprocess
result = subprocess.run([
'openssl', 's_client',
'-connect', 'secure.aerospike.example.com:4333',
'-tls1_3',
'-CAfile', '/path/to/ca.crt'
], capture_output=True, text=True)
print(result.stdout)

Verify server cipher support

Use OpenSSL to check which ciphers the server accepts:

Terminal window
# Check TLS 1.3 ciphers
openssl s_client -connect server:4333 -tls1_3 -ciphersuites TLS_AES_256_GCM_SHA384
# Check TLS 1.2 ciphers
openssl s_client -connect server:4333 -tls1_2 -cipher ECDHE-RSA-AES256-GCM-SHA384
# List all supported ciphers
nmap --script ssl-enum-ciphers -p 4333 server

Certificate chain verification

Verify your certificate chain is complete:

Terminal window
# Check certificate
openssl x509 -in server.crt -text -noout
# Verify chain
openssl verify -CAfile ca.crt server.crt
# Check key matches certificate
openssl x509 -noout -modulus -in server.crt | openssl md5
openssl rsa -noout -modulus -in server.key | openssl md5
# Both should output the same hash

Performance considerations

Cipher performance

CipherRelative PerformanceNotes
TLS_AES_128_GCM_SHA256FastestHardware AES-NI
TLS_AES_256_GCM_SHA384FastHardware AES-NI
TLS_CHACHA20_POLY1305_SHA256FastBetter on ARM without AES-NI
ECDHE-RSA-AES256-GCM-SHA384ModerateTLS 1.2, more CPU for key exchange

Recommendations

  1. Use TLS 1.3 when possible—faster handshakes, better security
  2. Prefer AES-GCM on x86 with AES-NI support
  3. Use ChaCha20 on ARM or older CPUs without AES-NI
  4. Enable session resumption to reduce handshake overhead
// Enable session caching (default in most JVMs)
SSLContext sslContext = SSLContext.getInstance("TLSv1.3");
SSLSessionContext sessionContext = sslContext.getClientSessionContext();
sessionContext.setSessionCacheSize(100);
sessionContext.setSessionTimeout(3600); // 1 hour

Next steps

Feedback

Was this page helpful?

What type of feedback are you giving?

What would you like us to know?

+Capture screenshot

Can we reach out to you?