-
-
Save tague/416405bf6427f8646107bfa10e1b4736 to your computer and use it in GitHub Desktop.
Sample Python SSL Redis Program
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python3 | |
import redis | |
import pprint | |
try: | |
r = redis.StrictRedis( | |
decode_responses=True, | |
host='redis-16148.c15.us-east-1-2.ec2.cloud.redislabs.com', | |
port=16148, | |
password='sekret', | |
ssl=True, | |
ssl_keyfile='./redislabs_user_private.key', | |
ssl_certfile='./redislabs_user.crt', | |
ssl_cert_reqs='required', | |
ssl_ca_certs='./redislabs_ca.pem', | |
) | |
info = r.info() | |
pprint.pprint(info) | |
except Exception as err: | |
print("Error connecting to Redis: {}".format(err)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment