Skip to content

Commit f0c0ab2

Browse files
authored
OCSP Stapling Support (#1873)
1 parent d129166 commit f0c0ab2

File tree

11 files changed

+571
-111
lines changed

11 files changed

+571
-111
lines changed

.github/workflows/integration.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
3131
run-tests:
3232
runs-on: ubuntu-latest
33+
timeout-minutes: 30
3334
strategy:
3435
max-parallel: 15
3536
matrix:

docs/examples.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ Examples
55
:maxdepth: 3
66
:glob:
77

8-
examples/connection_example
8+
examples/connection_examples
9+
examples/ssl_connection_examples

docs/examples/connection_example.ipynb renamed to docs/examples/connection_examples.ipynb

+9-84
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@
77
"# Connection Examples"
88
]
99
},
10-
{
11-
"cell_type": "code",
12-
"execution_count": 1,
13-
"metadata": {},
14-
"outputs": [],
15-
"source": [
16-
"import redis"
17-
]
18-
},
1910
{
2011
"cell_type": "markdown",
2112
"metadata": {},
@@ -40,6 +31,8 @@
4031
}
4132
],
4233
"source": [
34+
"import redis\n",
35+
"\n",
4336
"connection = redis.Redis()\n",
4437
"connection.ping()"
4538
]
@@ -68,8 +61,10 @@
6861
}
6962
],
7063
"source": [
71-
"decode_connection = redis.Redis(decode_responses=True)\n",
72-
"connection.ping()"
64+
"import redis\n",
65+
"\n",
66+
"decoded_connection = redis.Redis(decode_responses=True)\n",
67+
"decoded_connection.ping()"
7368
]
7469
},
7570
{
@@ -96,82 +91,12 @@
9691
}
9792
],
9893
"source": [
94+
"import redis\n",
95+
"\n",
9996
"user_connection = redis.Redis(host='localhost', port=6380, username='dvora', password='redis', decode_responses=True)\n",
10097
"user_connection.ping()"
10198
]
10299
},
103-
{
104-
"cell_type": "markdown",
105-
"metadata": {},
106-
"source": [
107-
"## Connecting to a Redis instance via SSL."
108-
]
109-
},
110-
{
111-
"cell_type": "code",
112-
"execution_count": 5,
113-
"metadata": {},
114-
"outputs": [
115-
{
116-
"data": {
117-
"text/plain": [
118-
"True"
119-
]
120-
},
121-
"execution_count": 5,
122-
"metadata": {},
123-
"output_type": "execute_result"
124-
}
125-
],
126-
"source": [
127-
"ssl_connection = redis.Redis(host='localhost', port=6666, ssl=True, ssl_cert_reqs=\"none\")\n",
128-
"ssl_connection.ping()"
129-
]
130-
},
131-
{
132-
"cell_type": "markdown",
133-
"metadata": {},
134-
"source": [
135-
"## Connecting to a Redis instance via SSL, while specifying a self-signed SSL certificate."
136-
]
137-
},
138-
{
139-
"cell_type": "code",
140-
"execution_count": 6,
141-
"metadata": {},
142-
"outputs": [
143-
{
144-
"data": {
145-
"text/plain": [
146-
"True"
147-
]
148-
},
149-
"execution_count": 6,
150-
"metadata": {},
151-
"output_type": "execute_result"
152-
}
153-
],
154-
"source": [
155-
"import os\n",
156-
"\n",
157-
"ROOT = os.path.join(os.getcwd(), \"..\", \"..\")\n",
158-
"CERT_DIR = os.path.abspath(os.path.join(ROOT, \"docker\", \"stunnel\", \"keys\"))\n",
159-
"ssl_certfile=os.path.join(CERT_DIR, \"server-cert.pem\")\n",
160-
"ssl_keyfile=os.path.join(CERT_DIR, \"server-key.pem\")\n",
161-
"ssl_ca_certs=os.path.join(CERT_DIR, \"server-cert.pem\")\n",
162-
"\n",
163-
"ssl_cert_conn = redis.Redis(\n",
164-
" host=\"localhost\",\n",
165-
" port=6666,\n",
166-
" ssl=True,\n",
167-
" ssl_certfile=ssl_certfile,\n",
168-
" ssl_keyfile=ssl_keyfile,\n",
169-
" ssl_cert_reqs=\"required\",\n",
170-
" ssl_ca_certs=ssl_ca_certs,\n",
171-
")\n",
172-
"ssl_cert_conn.ping()"
173-
]
174-
},
175100
{
176101
"cell_type": "markdown",
177102
"metadata": {},
@@ -203,7 +128,7 @@
203128
}
204129
],
205130
"source": [
206-
"url_connection = redis.from_url(\"rediss://localhost:6666?ssl_cert_reqs=none&decode_responses=True&health_check_interval=2\")\n",
131+
"url_connection = redis.from_url(\"redis://localhost:6379?decode_responses=True&health_check_interval=2\")\n",
207132
"\n",
208133
"url_connection.ping()"
209134
]

0 commit comments

Comments
 (0)