Some portals seem not to return root-ca entries, detect that and just continue

This commit is contained in:
Tino Lange
2019-06-14 12:58:30 +02:00
parent ceeaebba6d
commit 9ee875bf56
+6 -4
View File
@@ -478,10 +478,12 @@ def paloalto_getconfig(conf, s, saml_username, prelogin_cookie):
if len(portal_userauthcookie) == 0: if len(portal_userauthcookie) == 0:
err('empty portal_userauthcookie') err('empty portal_userauthcookie')
gateway = x.find('.//gateways//entry').get('name') # FIXME: this just grabs the very first, probably not what you want gateway = x.find('.//gateways//entry').get('name') # FIXME: this just grabs the very first, probably not what you want
for entry in x.find('.//root-ca'): xtmp = x.find('.//root-ca')
cert = entry.find('.//cert').text if xtmp is not None:
conf['openconnect_certs'].write(to_b(cert)) for entry in xtmp:
conf['openconnect_certs'].flush() cert = entry.find('.//cert').text
conf['openconnect_certs'].write(to_b(cert))
conf['openconnect_certs'].flush()
return portal_userauthcookie, gateway return portal_userauthcookie, gateway
# Combined first half of okta_saml with second half of okta_redirect # Combined first half of okta_saml with second half of okta_redirect