Skip to content

Commit 18c6809

Browse files
authored
Support for password-encrypted SSL private keys (#1782)
Adding support for SSL private keys with a password. This PR also adds support for future SSL tests.
1 parent a8b8f14 commit 18c6809

17 files changed

+215
-17
lines changed

.github/workflows/install_and_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ pip install ${PKG}
4242
pytest -m 'not onlycluster'
4343
# RedisCluster tests
4444
CLUSTER_URL="redis://localhost:16379/0"
45-
pytest -m 'not onlynoncluster and not redismod' --redis-url=${CLUSTER_URL}
45+
pytest -m 'not onlynoncluster and not redismod and not ssl' --redis-url=${CLUSTER_URL}

.github/workflows/integration.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
- name: run tests
4949
run: |
5050
pip install -r dev_requirements.txt
51+
bash docker/stunnel/create_certs.sh
5152
tox -e ${{matrix.test-type}}-${{matrix.connection-type}}
5253
- name: Upload codecov coverage
5354
uses: codecov/codecov-action@v2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ coverage.xml
1717
.venv
1818
*.xml
1919
.coverage*
20+
docker/stunnel/keys

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ can execute docker and its various commands.
5858
- A Redis replica node
5959
- Three sentinel Redis nodes
6060
- A multi-python docker, with your source code mounted in /data
61+
- An stunnel docker, fronting the master Redis node
6162

6263
The replica node, is a replica of the master node, using the
6364
[leader-follower replication](https://redis.io/topics/replication)
@@ -73,7 +74,7 @@ tests as well. With the 'tests' and 'all-tests' targets, all Redis and
7374
RedisCluster tests will be run.
7475

7576
It is possible to run only Redis client tests (with cluster mode disabled) by
76-
using `invoke redis-tests`; similarly, RedisCluster tests can be run by using
77+
using `invoke standalone-tests`; similarly, RedisCluster tests can be run by using
7778
`invoke cluster-tests`.
7879

7980
Each run of tox starts and stops the various dockers required. Sometimes

dev_requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ pytest==6.2.5
66
pytest-timeout==2.0.1
77
tox==3.24.4
88
tox-docker==3.1.0
9+
tox-run-before==0.1
910
invoke==1.6.0
1011
pytest-cov>=3.0.0
1112
vulture>=2.3.0

docker/base/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# produces redisfab/redis-py:6.2.6
12
FROM redis:6.2.6-buster
23

34
CMD ["redis-server", "/redis.conf"]

docker/base/Dockerfile.cluster

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
# produces redisfab/redis-py-cluster:6.2.6
12
FROM redis:6.2.6-buster
23

34
COPY create_cluster.sh /create_cluster.sh
45
RUN chmod +x /create_cluster.sh
56

67
EXPOSE 16379 16380 16381 16382 16383 16384
78

8-
CMD [ "/create_cluster.sh"]
9+
CMD [ "/create_cluster.sh"]

docker/base/Dockerfile.sentinel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# produces redisfab/redis-py-sentinel:6.2.6
12
FROM redis:6.2.6-buster
23

34
CMD ["redis-sentinel", "/sentinel.conf"]

docker/base/Dockerfile.stunnel

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# produces redisfab/stunnel:latest
2+
FROM ubuntu:18.04
3+
4+
RUN apt-get update -qq --fix-missing
5+
RUN apt-get upgrade -qqy
6+
RUN apt install -qqy stunnel
7+
RUN mkdir -p /etc/stunnel/conf.d
8+
RUN echo "foreground = yes\ninclude = /etc/stunnel/conf.d" > /etc/stunnel/stunnel.conf
9+
RUN chown -R root:root /etc/stunnel/
10+
11+
CMD ["/usr/bin/stunnel"]

docker/stunnel/conf/redis.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[redis]
2+
accept = 6666
3+
connect = master:6379
4+
cert = /etc/stunnel/keys/server-cert.pem
5+
key = /etc/stunnel/keys/server-key.pem
6+
verify = 0

0 commit comments

Comments
 (0)