Skip to content

Commit 431282b

Browse files
author
Jeremy Phelps
committed
Conditionally modify the context object instead of conditionally
returning early.
1 parent 13012b9 commit 431282b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pydruid/client.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -484,10 +484,9 @@ def __init__(self, url, endpoint):
484484

485485
def ssl_context(self):
486486
ctx = ssl.create_default_context()
487-
if not self.ignore_certificate_errors:
488-
return ctx
489-
ctx.check_hostname = False
490-
ctx.verify_mode = ssl.CERT_NONE
487+
if self.ignore_certificate_errors:
488+
ctx.check_hostname = False
489+
ctx.verify_mode = ssl.CERT_NONE
491490
return ctx
492491

493492
def _post(self, query):

0 commit comments

Comments
 (0)