Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARN gpgui::portal_connector] Failed to connect to the portal: Prelogin error: Invalid prelogin response #357

Closed
keisner opened this issue May 6, 2024 · 23 comments

Comments

@keisner
Copy link

keisner commented May 6, 2024

I continue to get the error Invalid prelogin response. I have tried changing most of the settings in the client, along with the "Versioning". Please see logs below:

Location: /home/cooljoe51/.local/share/gpclient/gpclient.log

[2024-05-06T15:46:47Z WARN gpgui::portal_connector] Failed to connect to the portal: Prelogin error: Invalid prelogin response
[2024-05-06T16:06:55Z INFO gpgui::handlers::subscription] Sending the init event to client: settings
[2024-05-06T16:06:55Z INFO gpgui::handlers::subscription] Sent the init event to client: settings
[2024-05-06T16:12:14Z INFO gpgui::portal_connector] Connecting to the portal: v**********m...
[2024-05-06T16:12:14Z INFO gpgui::portal_connector] Connecting the portal as a gateway...
[2024-05-06T16:12:14Z INFO gpgui::portal_connector] Gateway prelogin, gateway: v**********m...
[2024-05-06T16:12:14Z INFO gpapi::portal::prelogin] Gateway prelogin with user_agent: PAN GlobalProtect/5.2.6 (Microsoft Windows 11 Pro , 64-bit)
[2024-05-06T16:12:14Z WARN gpapi::portal::prelogin] Parse response error, response: <?xml version="1.0" encoding="UTF-8" ?>
[2024-05-06T16:12:14Z WARN gpgui::portal_connector] Failed to connect to the portal: Prelogin error: Invalid prelogin response
[2024-05-06T17:12:22Z INFO gpgui::portal_connector] Connecting to the portal: v**********m...
[2024-05-06T17:12:22Z INFO gpgui::portal_connector] Trying to connect the gateway directly...
[2024-05-06T17:12:22Z INFO gpgui::portal_connector] Failed to connect the gateway directly: No portal connection found
[2024-05-06T17:12:22Z INFO gpgui::portal_connector] Trying to connect portal with cached credential...
[2024-05-06T17:12:22Z INFO gpgui::portal_connector] Failed to connect portal with cached credential: No cached credential found for the portal
[2024-05-06T17:12:22Z INFO gpgui::portal_connector] Trying to connect the portal with prelogin...
[2024-05-06T17:12:22Z INFO gpgui::portal_connector] Performing portal prelogin...
[2024-05-06T17:12:22Z INFO gpapi::portal::prelogin] Portal prelogin with user_agent: PAN GlobalProtect/5.2.6 (Microsoft Windows 11 Pro , 64-bit)
[2024-05-06T17:12:22Z WARN gpapi::portal::prelogin] Parse response error, response: <?xml version="1.0" encoding="UTF-8" ?>
[2024-05-06T17:12:22Z INFO gpgui::portal_connector] Failed to connect the portal with prelogin: Prelogin error: Invalid prelogin response
[2024-05-06T17:12:22Z INFO gpgui::portal_connector] Trying to connect the portal as a gateway...
[2024-05-06T17:12:22Z INFO gpgui::portal_connector] Gateway prelogin, gateway: v**********m...
[2024-05-06T17:12:22Z INFO gpapi::portal::prelogin] Gateway prelogin with user_agent: PAN GlobalProtect/5.2.6 (Microsoft Windows 11 Pro , 64-bit)
[2024-05-06T17:12:22Z WARN gpapi::portal::prelogin] Parse response error, response: <?xml version="1.0" encoding="UTF-8" ?>
[2024-05-06T17:12:22Z WARN gpgui::portal_connector] Failed to connect to the portal: Prelogin error: Invalid prelogin response
[2024-05-06T18:34:59Z INFO gpgui::handlers::subscription] Sending the init event to client: settings
[2024-05-06T18:34:59Z INFO gpgui::handlers::subscription] Sent the init event to client: settings
@yuezk
Copy link
Owner

yuezk commented May 7, 2024

It seems that the portal pre-login endpoint returns an invalid XML response. What's the response of https://<vpn_portal>/global-protect/prelogin.esp.

@keisner
Copy link
Author

keisner commented May 7, 2024

Looks like Success:

<prelogin-response>
<status>Success</status>
<ccusername/>
<autosubmit>false</autosubmit>
<msg/>
<newmsg/>
<authentication-message>Enter login credentials</authentication-message>
<username-label/>
<password-label/>
<panos-version>1</panos-version>
<saml-default-browser>yes</saml-default-browser>
<auth-api>no</auth-api>
<region>US</region>
</prelogin-response>

@yuezk
Copy link
Owner

yuezk commented May 7, 2024

Hi @keisner can you help try this to see if it works for you.

  1. Click the top left menu, select Clear Credentials
  2. Click the icon of the portal input
    image
  3. Select the Portal Server
    image
  4. Connect it again.

Please provide the full logs if it still fails.

@keisner
Copy link
Author

keisner commented May 7, 2024 via email

@yuezk
Copy link
Owner

yuezk commented May 7, 2024

Have this client ever worked for you?

@keisner
Copy link
Author

keisner commented May 7, 2024 via email

@yuezk
Copy link
Owner

yuezk commented May 8, 2024

Yes. When I was version 9

What do you mean by version 9? Version 2.0.0-beta9?

@keisner
Copy link
Author

keisner commented May 8, 2024 via email

@yuezk
Copy link
Owner

yuezk commented May 9, 2024

Looks like Success:

<prelogin-response>
<status>Success</status>
<ccusername/>
<autosubmit>false</autosubmit>
<msg/>
<newmsg/>
<authentication-message>Enter login credentials</authentication-message>
<username-label/>
<password-label/>
<panos-version>1</panos-version>
<saml-default-browser>yes</saml-default-browser>
<auth-api>no</auth-api>
<region>US</region>
</prelogin-response>

Hi @keisner I can reproduce a similar error using this prelogin response.

Have you tried using the official client on macOS/Windows to connect this portal? Do they work for you?

@keisner
Copy link
Author

keisner commented May 9, 2024 via email

@yuezk
Copy link
Owner

yuezk commented May 9, 2024

I guess the official client asked you to input the username and password. Is that right? If yes, the reason might be that the prelogin response doesn't have values for username-label and password-label, this could fail parsing the prelogin response. I can use the fallback value for them.

@keisner
Copy link
Author

keisner commented May 9, 2024 via email

@yuezk
Copy link
Owner

yuezk commented May 9, 2024

I will provide a test package later today, you can give it a try.

@keisner
Copy link
Author

keisner commented May 9, 2024 via email

@yuezk
Copy link
Owner

yuezk commented May 9, 2024

@keisner, you can try the test package from https://github.com/yuezk/GlobalProtect-openconnect/releases/tag/snapshot. Remember to uninstall the globalprotect-openconnect package before installing the test package.

@keisner
Copy link
Author

keisner commented May 9, 2024 via email

@yuezk
Copy link
Owner

yuezk commented May 9, 2024

Hi @keisner would you mind send me your portal address via email [email protected]? So I can investigate it. The credentials are not needed.

@keisner
Copy link
Author

keisner commented May 9, 2024 via email

@yuezk
Copy link
Owner

yuezk commented May 10, 2024

Hi @keisner, it works for me with your VPN portal. I'm afraid this is related to the installation process. What's your OS and how did you install the old client?

Anyway, you can try these steps to see if it works for you:

  1. Quit the client
  2. Remove the package from your system.
  3. Run sudo rm -f /usr/bin/gpgui to ensure the old gpgui binary is removed.
  4. Install the test package from https://github.com/yuezk/GlobalProtect-openconnect/releases/tag/snapshot
  5. Launch the GUI client, which will download the snapshot gpgui dynamically.
  6. Check if it works for you.

@keisner
Copy link
Author

keisner commented May 13, 2024 via email

@yuezk
Copy link
Owner

yuezk commented May 15, 2024

Glad it worked for you. I will release the fix in v2.2.2

@keisner
Copy link
Author

keisner commented May 15, 2024 via email

@yuezk
Copy link
Owner

yuezk commented May 20, 2024

Released in 2.3.0, closing.

@yuezk yuezk closed this as completed May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants