-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Document TLS/SSL support #780
Comments
The various ways to use TLS with redis-py seem to be:
r = redis.StrictRedis(
host='HOSTNAME',
port=NNNN,
password='PASSWORD',
ssl=True,
# optional:
ssl_cert_reqs='required',
ssl_ca_certs='/path/to/custom/ca-cert',
)
redis_url = 'rediss://h:PASSWORD@HOSTNAME:NNNN?ssl_cert_reqs=required&ssl_ca_certs=/path/to/custom/ca-cert'
r = redis.StrictRedis.from_url(redis_url)
pool = redis.ConnectionPool(
host='HOSTNAME',
port=NNNN,
password='PASSWORD',
connection_class=redis.SSLConnection,
# optional:
ssl_cert_reqs='required',
ssl_ca_certs='/path/to/custom/ca-cert',
)
r = redis.StrictRedis(connection_pool=pool)
redis_url = 'rediss://h:PASSWORD@HOSTNAME:NNNN?ssl_cert_reqs=required&ssl_ca_certs=/path/to/custom/ca-cert'
pool = redis.ConnectionPool.from_url(redis_url)
r = redis.StrictRedis(connection_pool=pool) There are also a couple of typos in the changelog entry: |
I just hit this. If someone can point me at the correct section in the docs to update, I can write up the docs update. |
This issue is marked stale. It will be closed in 30 days if it is not updated. |
I'm still happy to write this up if I can get some pointers on which doc to update. |
a PR to fix the typos mentioned: #1362 |
@taion The documentation is generated from index.rst and the docstrings of the callable objects. |
Hmm, so I actually have no idea what's missing in the docs. The use of As far as I can tell, then, everything I would have needed back when I commented on this issue initially is now there. Maybe this can be closed out? |
I spent hours trying to figure out how the hell to get SSL to work when using a Finally finding this issue helped me figure it out. So... to answer "what's missing in the docs", I would say the examples from #780 (comment) would be a great addition. |
I am trying to connect to redis using username, password and ssl. pool = redis.ConnectionPool.from_url("rediss://"+username+":"+password+"@"+ip+":"+port+"?ssl_cert_reqs=required")
redisConnection = redis.StrictRedis(connection_pool=pool) Then an error like this is been raised: Traceback (most recent call last):
.
.
.
ValueError: Port could not be cast to integer value as 'password_value' In my understanding there is a bug while the url string is been cut to make port sub string. The ACL users has been made using this doc: And the connection has been using both redis-cli (and AUTH) and a Node.js app (Node Redis lib). I am feeling really confused because redis.StrictRedis and redis.Redis have no username argument to them constructors but if you dive a little deeper in lib code you can find that there is place for it (for example: in redis.Connection and redis.ConnectionPool). Could you please help me point out what exactly I am doing wrong? |
Incredible, open since 2016 and still attracting visitors in 2021. This issue has now truly graduated. |
I have successfully connected by this way
in case someone might meet the same problem, hope it will help! |
While not everything has been documented - we just merged in documentation and some examples (#1835) - including SSL. Those examples now publish to readthedocs, and are generated from jupyter notebooks. If you're able to, please help expand upon them! |
You have some pretty good docs on OCSP stapling, but if I don't do that then docs and functionality seem pretty weak for any kind of TLS configuration settings. I can't even specify a minimum protocol to be used? I have been trying to figure out how to "properly" configure TLS settings in this library for far too long (longer than a single work day) so any help here is appreciated :) |
@sav-norem. Wanna? |
@nermiller maybe you're interested? |
This issue is marked stale. It will be closed in 30 days if it is not updated. |
PR #446 added support for TLS, however it's currently undocumented.
I'm trying to add documentation/support for TLS to consumers of redis-py (eg django-redis/django-redis-cache), however this is harder when there isn't upstream documentation to refer to :-)
The text was updated successfully, but these errors were encountered: