yuezk / GlobalProtect-openconnect

A GlobalProtect VPN client for Linux, written in Rust, based on OpenConnect and Tauri, supports SSO with MFA, Yubikey, and client certificate authentication, etc.
GNU General Public License v3.0
1.37k stars 153 forks source link

ip:port recognized as domain #404

Open Asutorufa opened 3 months ago

Asutorufa commented 3 months ago

Logs


[2024-08-02T02:58:37Z INFO  gpapi::portal::prelogin] Gateway prelogin with user_agent: PAN GlobalProtect
Enter login credentials (Gateway: 1.2.3.4:9000)
> Password: ********
[2024-08-02T02:58:38Z INFO  gpapi::gateway::login] Gateway login, user_agent: PAN GlobalProtect
[2024-08-02T02:58:38Z INFO  openconnect::ffi] openconnect version: v9.12
[2024-08-02T02:58:38Z INFO  openconnect::ffi] User agent: PAN GlobalProtect
[2024-08-02T02:58:38Z INFO  openconnect::ffi] VPNC script: /etc/vpnc/vpnc-script
[2024-08-02T02:58:38Z INFO  openconnect::ffi] OS: linux
[2024-08-02T02:58:38Z INFO  openconnect::ffi] CSD_USER: 1000
[2024-08-02T02:58:38Z INFO  openconnect::ffi] CSD_WRAPPER: (null)
[2024-08-02T02:58:38Z INFO  openconnect::ffi] RECONNECT_TIMEOUT: 300
[2024-08-02T02:58:38Z INFO  openconnect::ffi] MTU: 0
[2024-08-02T02:58:38Z INFO  openconnect::ffi] DISABLE_IPV6: 0
[2024-08-02T02:58:38Z INFO  openconnect::ffi] POST https://1.2.3.4:9000/ssl-vpn/getconfig.esp
[2024-08-02T02:58:38Z WARN  openconnect::ffi] getaddrinfo failed for host '1.2.3.4:9000': Name or service not known
[2024-08-02T02:58:38Z WARN  openconnect::ffi] Failed to open HTTPS connection to 1.2.3.4:9000
[2024-08-02T02:58:38Z WARN  openconnect::ffi] openconnect_make_cstp_connection failed

Environment:

yuezk commented 2 months ago

Seems like the error is reported from the underlying OpenConnect library. It doesn't provide a way to set the host and the port separately.

How many gateways do you have and do they all use the non-standard (i.e. 443) ports?

Asutorufa commented 2 months ago

How many gateways do you have and do they all use the non-standard (i.e. 443) ports?

Only one, it provide by our company, i can't change it.

yuezk commented 2 months ago

Hi @Asutorufa if your portal doesn't use SSO for authentication, you can try to connect your portal with openconnect to see if it works.

sudo openconnect --protocol=gp <portal>