Install dependencies
update package information from repo
sudo apt update
install build dependencies
sudo apt install -y build-essential pkg-config libssl-dev tcl libjemalloc-dev wget
Download and extract the redis-cli source file
download the package
wget http://download.redis.io/redis-stable.tar.gz
extract the package
tar xvzf redis-stable.tar.gz
go inside the extracted directory
cd redis-stable
Build with tls enabled
remove previously generated build files
make distclean
build with tls option
make BUILD_TLS=yes
Once completed you can validate the build and connect to Redis-server
validate the redis-cli
Redis-CLI -h localhost -p 6379 --tls
localhost:6379> INFO SSL
SSL
ssl_enabled:yes
ssl_current_certificate_not_before_date:Jul 27 00:00:00 2021 GMT
ssl_current_certificate_not_after_date:Aug 25 23:59:59 2022 GMT
ssl_current_certificate_serial:ABCDEFGKKSHDJKAHSD05A15BF008A57002E8