Skip to content

Commit

Permalink
fix case w/ SSL certificate verification failed after previous changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tomweber-sas committed Dec 23, 2022
1 parent fe35c47 commit b74c648
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions saspy/sasiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,10 @@ def __init__(self, session, **kwargs):
# get Connections
if self.ssl:
if self.verify:
# handle having self signed certificate default on Viya w/out copies on client; still ssl, just not verifyable
# handle having self signed certificate default on Viya w/out copies on client; still ssl, just not verifiable
try:
self.REFConn = hc.HTTPSConnection(self.ip, self.port, timeout=self.timeout)
self.HTTPConn = hc.HTTPSConnection(self.ip, self.port, timeout=self.timeout)
self.REFConn = hc.HTTPSConnection(self.ip, self.port, timeout=self.timeout); self.REFConn.connect(); self.REFConn.close()
self.HTTPConn = hc.HTTPSConnection(self.ip, self.port, timeout=self.timeout); self.HTTPConn.connect(); self.HTTPConn.close()
except ssl.SSLError as e:
logger.warning("SSL certificate verification failed, creating an unverified SSL connection. Error was:"+str(e))
self.REFConn = hc.HTTPSConnection(self.ip, self.port, timeout=self.timeout, context=ssl._create_unverified_context())
Expand Down

0 comments on commit b74c648

Please sign in to comment.