Skip to content

Commit

Permalink
Merge pull request #1 from RoeyPrat/roey-pycodestyle_oridistor
Browse files Browse the repository at this point in the history
pycodestyle fixes to connection.py
  • Loading branch information
oridistor authored Nov 27, 2018
2 parents 9084735 + 3d56575 commit 62f1f19
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions redis/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,13 +734,14 @@ def _connect(self):
context.check_hostname = False
context.verify_mode = self.cert_reqs
if self.certfile and self.keyfile:
context.load_cert_chain(certfile=self.certfile, keyfile=self.keyfile)
context.load_cert_chain(certfile=self.certfile,
keyfile=self.keyfile)
if self.ca_certs:
context.load_verify_locations(self.ca_certs)
sock = context.wrap_socket(sock,
server_hostname=self.host)
sock = context.wrap_socket(sock, server_hostname=self.host)
else:
# In case this code runs in a version which is older than 2.7.9, we want to fall back to old code
# In case this code runs in a version which is older than 2.7.9,
# we want to fall back to old code
sock = ssl.wrap_socket(sock,
cert_reqs=self.cert_reqs,
keyfile=self.keyfile,
Expand Down

0 comments on commit 62f1f19

Please sign in to comment.