Redis Secure Extension
Description
EsRedisSslApp is an extension application for EsRedisApp that provides the necessary components to establish secure connections to a Redis server using SSL/TLS. It seamlessly integrates with the existing EsRedisClient and EsRedisClientPool by introducing a specialized connection options class.
This application leverages the SciSslSocketInterface for the underlying secure socket implementation, ensuring robust and reliable encrypted communication.
Prerequisites
Key Classes
-
EsRedisSslConnectionOptions: A subclass of EsRedisConnectionOptions that adds support for SSL/TLS configuration. It holds an instance of SciSslSocketConfiguration to define the parameters of the secure connection.
-
EsRedisClient (Extensions): Extended to recognize and handle EsRedisSslConnectionOptions. It delegates the responsibility of establishing the secure connection to the options object.
-
EsRedisClientPool (Extensions): Extended with a convenience creation method (host:port:size:sslOptions:) to easily create a pool of secure Redis clients.
Usage
To connect to a Redis server over SSL/TLS, you first need to create an instance of SciSslSocketConfiguration
to define your security settings (e.g., CA certificates). Then, you create an EsRedisSslConnectionOptions
instance, associate your SSL configuration with it, and finally, create the EsRedisClient.
| sslConfig sslOptions client |
"1. Create the SSL socket configuration. For a simple connection to a trusted
server, a new instance may be sufficient. For servers requiring verification,
specify the CA file, client certificates, etc."
sslConfig := SciSslSocketConfiguration new.
"Example for a server requiring verification:
caFile: '/path/to/your/ca.pem';
certificateFilename: '/path/to/client-cert.pem';
privateKeyFilename: '/path/to/client-key.pem';"
yourself.
"2. Create the Redis SSL connection options, providing the SSL configuration."
sslOptions := EsRedisSslConnectionOptions ssl
host: '127.0.0.1';
port: 6380; "Standard Redis SSL port is often 6380"
sslConfiguration: sslConfig.
"3. Create the client using the SSL options and connect."
client := EsRedisClient withOptions: sslOptions.
client connect.
"The client is now securely connected."
client server ping. "Should answer 'PONG'"
client disconnect.
Class Methods
None
Instance Methods
None
Last modified date: 01/22/2026