Unverified Commit f4cb207f authored by Sean Bleier's avatar Sean Bleier Committed by GitHub

Merge pull request #189 from sebleier/add-ssl-support

Add ssl support
parents f97ce688 44754d90
......@@ -24,3 +24,4 @@
| Tim Graham / timgraham <https://github.com/timgraham>
| Justin Arulnathan / dinie <justin@gizmag.com>
| Mariusz Felisiak / felixxm <felisiak.mariusz@gmail.com>
| metamatik <mr@babik.fr>
Copyright (c) 2015 Sean Bleier
Copyright (c) 2020 Sean Bleier
All rights reserved.
Redistribution and use in source and binary forms, with or without
......
......@@ -21,6 +21,11 @@ Docs can be found at http://django-redis-cache.readthedocs.org/en/latest/.
Changelog
=========
2.1.1
-----
* Fixes URL scheme for `rediss://`.
2.1.0
-----
......
......@@ -183,7 +183,14 @@ class BaseRedisCache(BaseCache):
socket_timeout=self.socket_timeout,
socket_connect_timeout=self.socket_connect_timeout,
)
client = self.Redis(**kwargs)
# remove socket-related connection arguments
if kwargs.get('ssl', False):
del kwargs['socket_timeout']
del kwargs['socket_connect_timeout']
del kwargs['unix_socket_path']
client = redis.Redis(**kwargs)
kwargs.update(
parser_class=self.parser_class,
connection_pool_class=self.connection_pool_class,
......@@ -423,8 +430,8 @@ class BaseRedisCache(BaseCache):
There are three timeouts you can specify:
``timeout``: Time in seconds that value at ``key`` is considered fresh.
``lock_timeout``: Time in seconds that the lock will stay active and prevent other threads or
processes from acquiring the lock.
``lock_timeout``: Time in seconds that the lock will stay active and prevent other threads
or processes from acquiring the lock.
``stale_cache_timeout``: Time in seconds that the stale cache will remain after the key has
expired. If ``None`` is specified, the stale value will remain indefinitely.
......
......@@ -24,8 +24,8 @@ class CacheConnectionPool(object):
client,
host='127.0.0.1',
port=6379,
db=1,
ssl=False,
db=1,
password=None,
parser_class=None,
unix_socket_path=None,
......
......@@ -6,7 +6,6 @@ from django.utils.encoding import force_text
from six import python_2_unicode_compatible, string_types
from six.moves.urllib.parse import parse_qs, urlparse
from redis._compat import unicode
from redis.connection import SSLConnection
......
......@@ -5,7 +5,7 @@ setup(
url="http://github.com/sebleier/django-redis-cache/",
author="Sean Bleier",
author_email="sebleier@gmail.com",
version="2.1.0",
version="2.1.1",
license="BSD",
packages=["redis_cache", "redis_cache.backends"],
description="Redis Cache Backend for Django",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment