Connecting to the TU Berlin VPN on Linux used to be a fight with Cisco's client. Now it's one click in the tray, 2FA included.
- Worked out what the server expects: embedded SSO browser, Cisco user agent, no group in the request
- Runs without sudo by handing the session cookie to NetworkManager
Why
Cisco’s VPN client and Linux don’t get along, so connecting to the uni VPN was a hassle every single time. I built a tray app that does it with the open-source openconnect instead. Now it’s one click, and a few friends use it too.
Convincing a picky server
openconnect speaks the same protocol as Cisco’s client, but the TU server is picky about who it talks to. Getting in meant figuring out its quirks one 404 at a time:
- SSO only in an embedded browser. The 2FA profiles use SAML single sign-on, and the server only offers it to an embedded browser, so the app reuses the WebKit login window that ships with
networkmanager-openconnect. - A Cisco user agent. With openconnect’s default user agent, the server answers
404and falls back to a form that can’t do 2FA. - No group in the request. Sending one also gives a
404; the default group is preselected in the login window instead. - NVIDIA + Wayland. WebKitGTK can stop redrawing, which makes the login look frozen. Two environment variables fix it.
- No sudo. The session cookie goes to NetworkManager, which runs openconnect itself. That only works if the profile’s secrets are marked as not saved.