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 @@ ...@@ -24,3 +24,4 @@
| Tim Graham / timgraham <https://github.com/timgraham> | Tim Graham / timgraham <https://github.com/timgraham>
| Justin Arulnathan / dinie <justin@gizmag.com> | Justin Arulnathan / dinie <justin@gizmag.com>
| Mariusz Felisiak / felixxm <felisiak.mariusz@gmail.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. All rights reserved.
Redistribution and use in source and binary forms, with or without 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/. ...@@ -21,6 +21,11 @@ Docs can be found at http://django-redis-cache.readthedocs.org/en/latest/.
Changelog Changelog
========= =========
2.1.1
-----
* Fixes URL scheme for `rediss://`.
2.1.0 2.1.0
----- -----
......
...@@ -183,7 +183,14 @@ class BaseRedisCache(BaseCache): ...@@ -183,7 +183,14 @@ class BaseRedisCache(BaseCache):
socket_timeout=self.socket_timeout, socket_timeout=self.socket_timeout,
socket_connect_timeout=self.socket_connect_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( kwargs.update(
parser_class=self.parser_class, parser_class=self.parser_class,
connection_pool_class=self.connection_pool_class, connection_pool_class=self.connection_pool_class,
...@@ -423,8 +430,8 @@ class BaseRedisCache(BaseCache): ...@@ -423,8 +430,8 @@ class BaseRedisCache(BaseCache):
There are three timeouts you can specify: There are three timeouts you can specify:
``timeout``: Time in seconds that value at ``key`` is considered fresh. ``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 ``lock_timeout``: Time in seconds that the lock will stay active and prevent other threads
processes from acquiring the lock. or processes from acquiring the lock.
``stale_cache_timeout``: Time in seconds that the stale cache will remain after the key has ``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. expired. If ``None`` is specified, the stale value will remain indefinitely.
......
...@@ -24,8 +24,8 @@ class CacheConnectionPool(object): ...@@ -24,8 +24,8 @@ class CacheConnectionPool(object):
client, client,
host='127.0.0.1', host='127.0.0.1',
port=6379, port=6379,
db=1,
ssl=False, ssl=False,
db=1,
password=None, password=None,
parser_class=None, parser_class=None,
unix_socket_path=None, unix_socket_path=None,
......
...@@ -6,7 +6,6 @@ from django.utils.encoding import force_text ...@@ -6,7 +6,6 @@ from django.utils.encoding import force_text
from six import python_2_unicode_compatible, string_types from six import python_2_unicode_compatible, string_types
from six.moves.urllib.parse import parse_qs, urlparse from six.moves.urllib.parse import parse_qs, urlparse
from redis._compat import unicode
from redis.connection import SSLConnection from redis.connection import SSLConnection
......
...@@ -5,7 +5,7 @@ setup( ...@@ -5,7 +5,7 @@ setup(
url="http://github.com/sebleier/django-redis-cache/", url="http://github.com/sebleier/django-redis-cache/",
author="Sean Bleier", author="Sean Bleier",
author_email="sebleier@gmail.com", author_email="sebleier@gmail.com",
version="2.1.0", version="2.1.1",
license="BSD", license="BSD",
packages=["redis_cache", "redis_cache.backends"], packages=["redis_cache", "redis_cache.backends"],
description="Redis Cache Backend for Django", 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