Skip to content

Commit

Permalink
Conditionally modify the context object instead of conditionally
Browse files Browse the repository at this point in the history
returning early.
  • Loading branch information
Jeremy Phelps committed Jan 19, 2018
1 parent 13012b9 commit 431282b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pydruid/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,10 +484,9 @@ def __init__(self, url, endpoint):

def ssl_context(self):
ctx = ssl.create_default_context()
if not self.ignore_certificate_errors:
return ctx
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
if self.ignore_certificate_errors:
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
return ctx

def _post(self, query):
Expand Down

0 comments on commit 431282b

Please sign in to comment.