A
A
andreys752021-03-25 12:37:53
Redis
andreys75, 2021-03-25 12:37:53

How to set up Redis with SSL(TLS) MacOS?

Good afternoon
When I try to set up Redis with ssl support, I get the following error:

% redis-cli --tls --cacert /usr/local/share/ca-certificates/ca.crt
Could not connect to Redis at 127.0.0.1:6379: SSL_connect failed: certificate verify failed
not connected>


At the same time, everything worked fine some time ago . I configured
this article https://godfrey-tutu.medium.com/redis-6-deployment... ran
the following commands to generate a certificate
mkdir /tmp/certs && cd /tmp/certs
openssl genrsa -out ca.key 4096
openssl req -x509 -new -nodes -sha256 -key ca.key -days 365 -subj '/O=A/CN=127.0.0.1' -out ca.crt
openssl genrsa -out redis.key 2048
mkdir /etc/ssl/private
openssl req -new -sha256 -nodes -key redis.key -subj '/O=A/CN=127.0.0.1' | openssl x509 -req -sha256 -CA ca.crt -CAkey ca.key -CAserial /etc/ssl/private/ca.txt -CAcreateserial -days 365 -out redis.crt


mkdir /usr/local/share/ca-certificates
cp ca.crt /usr/local/share/ca-certificates/
cp ca.key /etc/ssl/private/
cp redis.key /etc/ssl/private/
cp redis.crt /etc/ssl/

chown andreysylka /usr/local/share/ca-certificates/ca.crt
chmod 644 /usr/local/share/ca-certificates/ca.crt

chown andreysylka /etc/ssl/private/ca.key
chmod 400 /etc/ssl/private/ca.key

chown andreysylka /etc/ssl/private/redis.key
chmod 400 /etc/ssl/private/redis.key

chown andreysylka /etc/ssl/redis.crt
chmod 644 /etc/ssl/redis.crt

I have already regenerated the certificates several times, tried to reinstall the radish

From what has changed - I installed the latest MacOS upgrade

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question