Fixed the generic names for the connection types

This commit is contained in:
Ezri Brimhall 2025-06-25 14:09:23 -06:00
parent f69b586aa9
commit 240ec5c64b
Signed by: ezri
GPG Key ID: 058A78E5680C6F24

View File

@ -101,7 +101,7 @@ class GlobalProtectConnection(
if not verify: if not verify:
# Disabling certificate verification is extremely dangerous and should only be done if you KNOW WHAT YOU ARE DOING # Disabling certificate verification is extremely dangerous and should only be done if you KNOW WHAT YOU ARE DOING
self.logger.warn("Certificate verification disabled! This is dangerous!") self.logger.warn("Certificate verification disabled! This is dangerous!")
if options.get("login_target").value == LoginTarget.GATEWAY: if options.get("login_target").value in {LoginTarget.GATEWAY, LoginTarget.SSL}:
url = f"{options.get('hostname').value}/ssl-vpn/prelogin.esp" url = f"{options.get('hostname').value}/ssl-vpn/prelogin.esp"
else: else:
url = f"{options.get('hostname').value}/global-protect/prelogin.esp" url = f"{options.get('hostname').value}/global-protect/prelogin.esp"
@ -248,7 +248,7 @@ class GlobalProtectConnection(
"--protocol=gp", "--protocol=gp",
f"--user={auth.value.get('saml-username')}", f"--user={auth.value.get('saml-username')}",
"--useragent=PAN GlobalProtect", "--useragent=PAN GlobalProtect",
f"--usergroup={options.get('login_target', Variant('s', LoginTarget.PORTAL)).value == LoginTarget.PORTAL and 'portal' or 'gateway'}:prelogin-cookie", f"--usergroup={options.get('login_target', Variant('s', LoginTarget.PORTAL)).value in {LoginTarget.PORTAL, LoginTarget.IPSEC} and 'portal' or 'gateway'}:prelogin-cookie",
"--passwd-on-stdin", "--passwd-on-stdin",
options.get("hostname").value, options.get("hostname").value,
"-b", "-b",
@ -421,6 +421,7 @@ class GlobalProtectConnection(
LoginTarget.SSL, LoginTarget.SSL,
LoginTarget.IPSEC, LoginTarget.IPSEC,
], ],
default=LoginTarget.IPSEC,
), ),
ConfigSpec( ConfigSpec(
name="spoof_clientos", name="spoof_clientos",