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 {GlideClusterClient} from "@valkey/valkey-glide";
const addresses = [
{
host: "address.example.com",
port: 6379
}
];
const client = await GlideClusterClient.createClient({
addresses: addresses,
useTLS: true
});

Example: Connecting with TLS Mode Enabled to a Standalone

Section titled “Example: Connecting with TLS Mode Enabled to a Standalone”
import {GlideClient} from "@valkey/valkey-glide";
const addresses = [
{
host: "address.example.com",
port: 6379
}
];
const client = await GlideClient.createClient({
addresses: addresses,
useTLS: true
});