Skip to content

Commit

Permalink
check compatibility of secure flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jburel committed Apr 11, 2024
1 parent 01fc825 commit 64bf1f9
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/omero/gateway/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,7 @@ class _BlitzGateway (object):

def __init__(self, username=None, passwd=None, client_obj=None, group=None,
clone=False, try_super=False, host=None, port=None,
extra_config=None, secure=False, anonymous=True,
extra_config=None, secure=None, anonymous=True,
useragent=None, userip=None):
"""
Create the connection wrapper.
Expand Down Expand Up @@ -1538,6 +1538,18 @@ def __init__(self, username=None, passwd=None, client_obj=None, group=None,
self.port = pc
elif pc != self.port:
raise Exception("ports %s and %s do not match" % (pc, self.port))
if self.c is None:
if secure is None:
secure = False
else:
cs = self.c.isSecure()
if secure is None:
secure = cs
else:
# Check that the values match
if secure != cs:
raise Exception("Secure flag %s and %s do not match" % (secure, cs))

self.secure = secure
self.useragent = useragent
self.userip = userip
Expand Down Expand Up @@ -2047,7 +2059,7 @@ def isSecure(self):
Returns 'True' if the underlying omero.clients.BaseClient is connected
using SSL
"""
return hasattr(self.c, 'isSecure') and self.c.isSecure() or False
return self.secure

def _getSessionId(self):
return self.c.getSessionId()
Expand Down

0 comments on commit 64bf1f9

Please sign in to comment.