Openconnect 通过命令行工作正常。
$ sudo openconnect foo.com/bar
POST https://foo.com/bar
Attempting to connect to server 1.2.3.4:443
Connected to 1.2.3.4:443
SSL negotiation with foo.com
Connected to HTTPS on foo.com
Got HTTP response: HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Cache-Control: no-cache
Pragma: no-cache
Connection: Keep-Alive
Date: Fri, 04 Aug 2017 08:28:32 GMT
X-Frame-Options: SAMEORIGIN
X-Aggregate-Auth: 1
HTTP body chunked (-2)
XML POST enabled
Please enter your username and password.
Username:baz
Password:
但是,通过网络管理器失败。我单击连接到 VPN,这会弹出一个窗口。然后,我再次单击“连接”图标,然后我会看到Failed to find or parse web form in login page
.日志如下。
GET https://foo.com/bar
Attempting to connect to server 1.2.3.4:443
Connected to 1.2.3.4:443
SSL negotiation with foo.com
Connected to HTTPS on foo.com
Got HTTP response: HTTP/1.0 200 OK
Content-Length: 110
Cache-Control: no-cache
Pragma: no-cache
Connection: Close
Date: Fri, 04 Aug 2017 08:31:22 GMT
HTTP body length: (110)
Failed to find or parse web form in login page
有一些差异,例如GET
与POST
、 和Content-Type
。我不确定这是否重要。这是 NetworkManager 配置文件:
$ sudo cat /etc/NetworkManager/system-connections/foo_VPN
[connection]
id=foo_VPN
uuid=<random string>
type=vpn
permissions=user:sparhawk:;
[vpn]
autoconnect-flags=0
certsigs-flags=0
cookie-flags=2
enable_csd_trojan=no
gateway=foo.cam/bar
gateway-flags=2
gwcert-flags=2
lasthost-flags=0
pem_passphrase_fsid=no
protocol=nc
xmlconfig-flags=0
service-type=org.freedesktop.NetworkManager.openconnect
[ipv4]
dns-search=
method=auto
[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto
我正在使用最新的 Arch Linux,并且openconnect
已networkmanager-openconnect
安装。我正在使用 KDE Plasma(如果相关的话)。