Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TLS configuration instructions #33

Merged
merged 6 commits into from
Sep 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions docs/tls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Aerospike JDBC TLS Configuration Parameters

The Aerospike JDBC driver can be configured to use SSL through the JDBC connection URL.

Below are the tls-related configs for aerospike-jdbc (example with value):
```tlsEnabled true
himanchali marked this conversation as resolved.
Show resolved Hide resolved
tlsName TLS_NAME
tlsStoreType (like jks)
tlsTruststorePassword. ******* (if required)
tlsTruststorePath. ./../XXX.jks (the full path)
himanchali marked this conversation as resolved.
Show resolved Hide resolved
```
The full list of the valid values can be found at [AerospikeTLSPolicyConfig](https://github.com/aerospike/aerospike-jdbc/blob/main/src/main/java/com/aerospike/jdbc/tls/AerospikeTLSPolicyConfig.java).

The configuration expects a standard Java truststore. The example to add CA certificate to Java Truststore can be found at [Add CA certificate to Java TrustStore on client nodes](https://docs.aerospike.com/server/operations/configure/network/tls/mtls_java#add-ca-certificate-to-java-truststore-on-client-nodes).
himanchali marked this conversation as resolved.
Show resolved Hide resolved

```keytool -import -alias tls1 -file /etc/aerospike/ssl/tls1/cert.pem -keystore //usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts -storePass changeit
himanchali marked this conversation as resolved.
Show resolved Hide resolved
```
Here are some working URL example using the above configs:
himanchali marked this conversation as resolved.
Show resolved Hide resolved

```//aerospike server detail
himanchali marked this conversation as resolved.
Show resolved Hide resolved
//host:172.17.0.9 port:4333 namespace:test tlsname:tls1 (as per the CN, same used in the truststore alias as well)

//connection URL example1
"jdbc:aerospike:172.17.0.9:4333/test?tlsEnabled=true&tlsName=tls1&tlsTruststorePath=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts&tlsTruststorePassword=changeit";

//connection URL example2
"jdbc:aerospike:172.17.0.9:4333/test?tlsEnabled=true&tlsName=tls1&tlsStoreType=jks&tlsTruststorePath=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts&tlsTruststorePassword=changeit";
```