Skip to content

TLS

Valkey GLIDE supports secure TLS connections to a data store.

It’s important to note that TLS support in Valkey GLIDE relies on rusttls. Currently, Valkey GLIDE employs the default rustls settings with no option for customization.

Example: Connecting with TLS Mode Enabled to a Cluster

Section titled “Example: Connecting with TLS Mode Enabled to a Cluster”
import glide.api.GlideClusterClient;
import glide.api.models.configuration.GlideClusterClientConfiguration;
import glide.api.models.configuration.NodeAddress;
GlideClusterClientConfiguration config = GlideClusterClientConfiguration.builder()
.address(NodeAddress.builder()
.host("adress.example.com")
.port(6379)
.build())
.useTLS(true)
.build();
GlideClusterClient client = GlideClusterClient.createClient(config).get();

Example: Connecting with TLS Mode Enabled to a Standalone server

Section titled “Example: Connecting with TLS Mode Enabled to a Standalone server”
import glide.api.GlideClient;
import glide.api.models.configuration.GlideClientConfiguration;
import glide.api.models.configuration.NodeAddress;
GlideClientConfiguration config = GlideClientConfiguration.builder()
.address(NodeAddress.builder()
.host("primary.example.com")
.port(6379)
.build())
.useTLS(true)
.build();
GlideClient client = GlideClient.createClient(config).get();