Jedis supports SSL with client certificate authentication.
Example on how to use it to connect to redis labs SSL enabled resource, with client certificate authentication:
import java.io.File;
import java.net.URI;
import redis.clients.jedis.Jedis;
public class testJedisSSL {
public static void main(String[] args) {
int port = 1234;
String password = "123456";
String trustStoreFilePath = "C:\\Users\\Demo\\Downloads\\Credentials\\keystore.jks";
String trustStoreType = "jks";
String trustStorePassword = "changeit";
String keyStoreFilePath = "C:\\Users\\Demo\\Downloads\\Credentials\\JedisSSL.p12";
String keyStoreType = "PKCS12";
String keyStorePassword = "changeit";
if(!new File(trustStoreFilePath).exists()) {
String.format("Could not find trust store at '%s'.", trustStoreFilePath);
return;
}
System.setProperty("javax.net.ssl.trustStore", trustStoreFilePath);
System.setProperty("javax.net.ssl.trustStoreType", trustStoreType);
System.setProperty("javax.net.ssl.trustStorePassword", trustStorePassword);
System.setProperty("javax.net.ssl.keyStore", keyStoreFilePath);
System.setProperty("javax.net.ssl.keyStorePassword", keyStorePassword);
System.setProperty("javax.net.ssl.keyStoreType", keyStoreType);
Jedis jedis = new Jedis(URI.create("rediss://" + hostName + ":" + port));
jedis.auth(password);
System.out.println("foo = " + jedis.get("foo"));
jedis.close();
}
}