ste
ste

Reputation: 3269

redis-cli: Unrecognized option or bad number of args for: '--tls'

I'm trying to start a redis server with the support for tls. Based on the documentation (https://redis.io/topics/rediscli) I execute this command:

redis-cli -a xxxxxxxxx --tls --cacert ../config/certs/test-ca.crt

But it return this error:

Unrecognized option or bad number of args for: '--tls'

My redis-cli version is 6.0.9

I can't figure out what am I missing. How can I fix this?

Upvotes: 14

Views: 21822

Answers (2)

Vaibhav Jain
Vaibhav Jain

Reputation: 397

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

Upvotes: 9

Yoni
Yoni

Reputation: 440

When you performed make of the redis, you should run as: make BUILD_TLS=yes

Upvotes: 26

Related Questions