Closed lvml closed 2 years ago
But I had to apply a minor modification, as gp_saml_gui.py seems to use client certificates supplied with the
-c
option only for the TLS connections that it establishes itself - it does not pass the certificate to openconnect via openconnect's-c
option:
Yes, that's a good catch.
Explanation of why this happened:
gp-saml-gui
takes care to specify equivalent options to openconnect
as it uses for its own connections, e.g. --clientos Windows
not only modifies the HTTPS requests sent by gp-saml-gui
itself but also provides the --os=win
argument to openconnect
.gp-saml-gui --cert
different. That's because the client certificate should only be needed in the "authentication phase" of the GP VPN connection. Once the authcookie
has been determined and OpenConnect is ready for the tunnel/transport phase, there should be no need for TLS certs.gp-saml-gui
. So we do need to provide the --certificate
/--sslkey
args to it.Now I'm wondering if the webview may also need the client cert in some cases :thinking:. Probably not, because it's always hosted on a third-party domain in "real" GP VPNs, but perhaps we should include it for future-proofing.
@lvml wrote:
BTW: While debugging this, I noticed that the output of
print('''Launching OpenConnect with {}, equivalent to:\n{}''' ...
is somewhat misleading when the openconnect conversation with the GP gateway expects some input from standard-in - using--passwd-on-stdin
along with piped input the way suggested by the printed command line does not work then - while the direct invocation of openconnect by the gp_saml_gui.py script works just fine.
Hmmm. Can you show me a (redacted) example of this? What OS are you running on? What openconnect --version
?
Hi Dan, first of all thanks for the gp-saml-gui tool, which works for me to establish a VPN connection via a GlobalProtect gateway after an SAML authentication detour through login.microsoftonline.com.
But I had to apply a minor modification, as gp_saml_gui.py seems to use client certificates supplied with the
-c
option only for the TLS connections that it establishes itself - it does not pass the certificate to openconnect via openconnect's-c
option:Above change may not be as generic as one might want it to be, but it worked for my case where the GP gateway expects me to present a valid client certificate.
BTW: While debugging this, I noticed that the output of
print('''Launching OpenConnect with {}, equivalent to:\n{}''' ...
is somewhat misleading when the openconnect conversation with the GP gateway expects some input from standard-in - using--passwd-on-stdin
along with piped input the way suggested by the printed command line does not work then - while the direct invocation of openconnect by the gp_saml_gui.py script works just fine.