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

2

13

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?

Leptophyllous answered 12/1, 2021 at 11:50 Comment(0)
K
23

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

Kiarakibble answered 12/1, 2021 at 14:17 Comment(3)
I used brew to install redis on osx and had version 5 installed. brew upgrade redis upgraded to 6.0.1 with TLS support includedSpore
If one gets fatal error: openssl/ssl.h: No such file or directory. Run: sudo apt install openssl libssl-devUnsung
can anyone please guide on how to connect from windows machine, I am also facing similar error ?Heater
V
9

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
Vidette answered 29/8, 2022 at 10:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.