Skip to content

Commit

Permalink
fix: connect to redis over tls
Browse files Browse the repository at this point in the history
  • Loading branch information
jose-fully-ported committed Nov 23, 2023
1 parent d9fb55e commit 8426814
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions web.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,15 @@ def redis_path():
port = int(os.getenv("REDIS_PORT"))
password = os.getenv("REDIS_PASS")
connection = redis.Redis(
host=host, port=port, password=password, decode_responses=True
host=host,
port=port,
password=password,
decode_responses=True,
ssl=True,
ssl_cert_reqs="none",
)
connection.set("foo", "bar")
html = f"<pre><code>{connection.get('foo')}</code></pre>"
html = f"<pre><code>ping redis with tls: {connection.ping()}</code></pre>"
return html, 200


Expand Down

0 comments on commit 8426814

Please sign in to comment.