Skip to content

Instantly share code, notes, and snippets.

@karussell
Forked from eransharv/RedissonSSL.java
Last active February 24, 2021 16:27
Show Gist options
  • Save karussell/de87412e09722cf05fc64be59dac924b to your computer and use it in GitHub Desktop.
Save karussell/de87412e09722cf05fc64be59dac924b to your computer and use it in GitHub Desktop.
java lettuce redis client example using SSL
Download the CA and user certificates:
my_ca.pem
user.pem
user.key
Create p12 file, using the user.pem file and the private key file:
> openssl pkcs12 -export -in user.pem -inkey user.key -out user.p12
Create the jks file, using the pem file:
> keytool -import -alias sometest -file my_ca.pem -keystore keystore.jks
client.setOptions(ClientOptions.builder().sslOptions(SslOptions.builder()
.keystore(new File("user.p12"), "test12".toCharArray())
.truststore(new File("keystore.jks"), "keystorepassword12")
.build()).build());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment