-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redis tls not working (certificate verify failed) #8854
Comments
Are you able to reproduce using using auto-generated certs ( |
Auto generated certs work fine, mine don't I'm using the same procedure to generate nginx client certs and PostgreSQL certs, both are working Also, on my machine it works, the certs are accepted, but on the container, they give this error |
Did you configure the SAN (Subject Alternative Names) including Redis service DNS name when creating the certificates? Check how's it done using auto-generated certificates:
This is usually required if the clients validate the hostname in the certificate emitted by the server. |
I'm using easyRSA to generate the certificates, they have DNS related attributes Also, I'm using the same client (redis-cli 6.2.6) from my machine to connect to the container and the local redis-server Just to try make things clearer:
The liveness_probe can't success and the container is killed all the time |
Are you including "localhost" and "127.0.0.1" in the SAN? Maybe the reason why probes are failing is because you're missing that hostname and therefore the client can't verify the certificates. Please check the list of alternatives names we set here: |
This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback. |
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary. |
I have exactly the same problem with certificates (stored in a secret) generated by cert-manager
|
I had the same error as the OP and the search for an answer led me here so posting how I got past the error in hopes it helps someone else. I generate my own Intermediate Cert for the dev cluster and use cert-manager to generate the server cert and key. I had the same error so I tested the auto generated cert with redis and everything matched except for the extended usage param. I needed to add a usage param usages:
- digital signature
- key encipherment
- server auth
- client auth After adding client auth, then the liveness and readiness probe worked fine with no restarts so far. In looking into the usages params with cert-manager, it appears it doesn't add client auth if not specified. |
This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback. |
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary. |
@juan131 Hey Juan, how does autogenerated tls work? I just enabled it in helm chart and then don't understand how to proceed. Documentation is not too much clear for me. |
TLS certs are created using Helm capabilities (see |
@juan131 Those cert files are ready to be used by software clients like redis-cli to connect with redis server in this way |
Think I got the solution ! Thank u so much for the help |
For others who run into this problem I suggest looking at #30305 which may offer a workaround in some cases, particularly if you're trying to use a Also, in my experience,
is not necessary and not possible unless certificates are self-signed, so if you're using a real certificate, don't bother with this path. |
Which chart: redis:16.2.1
Describe the bug
I generated some certs with easyRSA, the same way I have with nginx and PostgreSQL.
I've tried locally to run
redis-server
andredis-cli
with the tls certs and it works fine.I added the ca.cert, server.key and server.cert to a secret and just to make sure, I ran again redis server and client with the kubernetes secrets using
kubectl get secret redis-tls -n redis --output="jsonpath={ .data.ca\.crt }" | base64 -d
just to make sure the secrets are ok and it workedAfter I install the chart and the container it
0/1 Running
I can open the logs and see these lines:I disabled the probes so the container is not restarted all the time and the issue still persists, I can use the server keys or the client keys, nothing changes
To Reproduce
Steps to reproduce the behavior:
helm install my-redis bitnami/redis -n redis -f values/redis.yaml
kubectl logs -f pod/$(kubectl get pods -A --template='{{range .items}}{{ .metadata.name }}{{" -n "}}{{ .metadata.namespace }}{{"\n"}}{{end}}' | grep redis)
helm install my-redis bitnami/redis -n redis -f values/redis.yaml
Expected behavior
The certs that work on my machine should also work on the container
Additional context
Log when probes are enabled:
Logs when probe is not enabled
The text was updated successfully, but these errors were encountered: