OpenConnect: the AnyConnect-compatible VPN protocol, client and ocserv server

OpenConnect is an open source VPN client, stable since version 1.00 in 2009, that speaks Cisco's AnyConnect protocol and six other corporate SSL VPN protocols. Its sister project ocserv is a free server for the same protocol, so both OpenConnect and Cisco's own client connect to it. The client logs in over HTTPS, then carries IP packets in a TLS tunnel on TCP 443 and, where UDP gets through, in DTLS.

Updated

On this page

Facts

What it is

SSL VPN: full IP tunnel, AnyConnect-compatible client and server

Since, by

Client 2009, ocserv server 2013; open source community

Transport

TLS over TCP, plus DTLS over UDP for data

Encryption

TLS 1.2+ and DTLS; old Cisco DTLS for legacy clients

To the network it looks like

HTTPS to one server, plus DTLS on UDP

Usual port

443 on TCP and UDP (ocserv defaults)

Comes as

Server URL and login; ocserv.conf on the server

License

Client LGPL-2.1, ocserv GPLv2+

In Veli

Not supported

Versions and history

  1. 2009

    OpenConnect 1.00

    The first non-beta release of the client comes out on 18 March 2009. The project started because Cisco's own AnyConnect client fell short on Linux.

  2. 2013

    ocserv 0.0.1

    The server side appears on 20 February 2013: an AnyConnect-compatible VPN server for Linux under GPLv2+.

  3. 2015–2019

    Beyond Cisco

    Juniper SSL VPN arrives in 7.05 (2015), Palo Alto GlobalProtect in 8.00 and Pulse Connect Secure in 8.04 (both 2019).

  4. 2022

    F5, Fortinet, Array

    Version 8.20 (February 2022) adds F5 Big-IP, Fortinet FortiGate and Array Networks SSL VPN, each chosen with --protocol.

  5. 2023

    Camouflage, draft 04

    ocserv 1.2.0 (July 2023) adds camouflage, which hides the VPN behind a secret URL. The open protocol description reaches draft-mavrogiannopoulos-openconnect-04 the same month and later expires.

  6. 2026

    OpenConnect 9.20, ocserv 1.6.0

    After three years without a release the client ships 9.20 and 9.21 in June 2026; ocserv 1.6.0 follows on 16 October.

How an OpenConnect session works

The client opens TLS to the server, usually on TCP 443, and logs in with ordinary HTTP requests. It posts an XML document called config-auth and gets back a form with username and password fields; there can be several rounds, for a one-time code for example. A client certificate or Kerberos (SPNEGO) can replace the password.

After login the client sends CONNECT /CSCOSSLC/tunnel on the same connection. The server replies with headers that set up the VPN: X-CSTP-Address and X-CSTP-Netmask give the client its address, X-CSTP-DNS the resolvers, X-CSTP-Split-Include the routes. With no split routes the client sends everything through the tunnel. From then on IP packets travel inside TLS, each behind an 8-byte header that starts with the bytes STF. This channel is called CSTP.

TCP inside TCP stalls on lossy lines, so the client also tries UDP. It asks for DTLS with X-DTLS-CipherSuite: PSK-NEGOTIATE, the server answers with X-DTLS-Port and X-DTLS-App-ID, and both sides derive the DTLS key from the TLS session (an RFC 5705 exporter with the label EXPORTER-openconnect-psk), so no key crosses the wire. If UDP is blocked, the TLS channel carries everything on its own.

Older Cisco clients use a DTLS variant that predates the standard. ocserv still speaks it when cisco-client-compat and dtls-legacy are on; OpenConnect 7.08 and newer use the PSK method instead.

One client, seven VPN protocols

The --protocol option picks the kind of gateway. Cisco's protocol is the default, and the manual still marks the other six as experimental. Some of them send data over ESP instead of DTLS; --no-dtls turns off both. Cisco renamed its own client to Cisco Secure Client (including AnyConnect) with release 5, and the protocol kept working as before.

  • anyconnect

    GatewayCisco AnyConnect and Secure Client gateways, ocserv

    Supported since1.00, 2009

  • nc

    GatewayJuniper Network Connect

    Supported since7.05, 2015

  • gp

    GatewayPalo Alto Networks GlobalProtect

    Supported since8.00, 2019

  • pulse

    GatewayPulse Connect Secure, now Ivanti

    Supported since8.04, 2019

  • f5

    GatewayF5 Big-IP

    Supported since8.20, 2022

  • fortinet

    GatewayFortinet FortiGate

    Supported since8.20, 2022

  • array

    GatewayArray Networks SSL VPN

    Supported since8.20, 2022

ocserv settings and the client command

There is no share link like vless://. A client needs the server address, a login and, for a server with a private certificate, a pin of its key. On the server everything sits in ocserv.conf; these are the lines that decide what the network and a prober get to see.

Linux or macOS terminal: connect to ocserv with camouflage
sudo openconnect --protocol=anyconnect -u alice --servercert pin-sha256:q5Gz1nJ3Vf0bT7uK2mY8xWcE4rP6sA9dL1hN0oQ3iZk= https://vpn.example.com/?mysecretkey

--servercert accepts only the server key with this pin and turns off the system CA check. For a certificate from a public CA, leave it out.

  • tcp-port, udp-port

    Example443

    What it doesTLS and DTLS ports, one pair for the whole server

  • auth

    Exampleplain[passwd=/etc/ocserv/ocpasswd]

    What it doesLogin method: plain, PAM, RADIUS, certificate, GSSAPI or OIDC

  • camouflage

    Exampletrue

    What it doesWithout the secret the server answers like a web server

  • camouflage_secret

    Examplemysecretkey

    What it doesThe word a client puts after ? in the server URL

  • camouflage_realm

    ExampleRestricted Content

    What it doesBrowser login prompt; when unset, 404 instead of 401

  • cisco-client-compat, dtls-legacy

    Exampletrue

    What it doesOld pre-standard DTLS for legacy Cisco clients

  • dpd

    Example90

    What it doesDead peer detection, in seconds

What a censor sees

Passively, OpenConnect is a TLS connection to one server on TCP 443 and, with DTLS on, a DTLS session to UDP 443 of the same host. The login, the CONNECT request and the X-CSTP headers all travel inside TLS, so an observer sees the server name in the ClientHello and a long-lived connection, not the VPN headers.

Active probing is the weaker spot. In October 2020 an OpenConnect maintainer wrote on the project's mailing list that the /CSCOSSLC/tunnel path cannot change because every client uses it, and that ocserv's TLS library, GnuTLS, is rare among real web servers, so its TLS fingerprint alone can give the server away.

Camouflage, added in ocserv 1.2.0 in 2023, answers the first point: without the secret in the URL every request gets an HTTP error, 401 with a login prompt or 404. The sample config itself advises changing the default realm, since Restricted Content is a fingerprint too. Cisco's desktop clients check for a captive portal at the address without the secret, so that check has to be turned off for them to connect. Camouflage does not change the TLS fingerprint.

We found no published measurement of how censors detect OpenConnect or ocserv. The closest work is Xue et al. at USENIX Security 2024: they detected obfuscated proxies by the TLS handshakes nested inside the outer encryption, a trait their paper ties to every kind of proxying and tunnelling. OpenConnect was not tested by name.

Strengths and weaknesses

Strengths

  • One open client speaks seven SSL VPN protocols, from Cisco to Fortinet
  • ocserv is free and accepts both OpenConnect and Cisco's official clients
  • Keeps working over TLS on TCP 443 when UDP is closed
  • Camouflage hides the VPN behind a secret URL
  • Long history: client since 2009, server since 2013, releases in 2026

Weaknesses

  • The protocol is Cisco's; the open description is an expired draft, not a standard
  • Without camouflage the fixed tunnel path gives the server away to a probe
  • ocserv's GnuTLS handshake is rare among web servers
  • Over TCP alone it is TCP inside TCP and slows down on lossy lines
  • Six of the seven protocols are still marked experimental

Sources

How we write and check

In Veli

OpenConnect in Veli

Veli does not connect OpenConnect, AnyConnect or ocserv servers. For them you need OpenConnect itself or Cisco Secure Client.

Veli opens VLESS, VMess, Trojan, Shadowsocks, Hysteria2, TUIC, WireGuard, AmneziaWG and OpenVPN; OpenVPN on Windows and Linux.

Questions

Is OpenConnect the same as Cisco AnyConnect?

No. OpenConnect is an independent open source client that speaks the AnyConnect protocol. Cisco's own client is now called Cisco Secure Client, and both connect to Cisco gateways and to ocserv.

What is ocserv?

The OpenConnect VPN server: an open source, AnyConnect-compatible server for Linux, also known to run on the BSDs, under GPLv2+. It logs users in with passwords, PAM, RADIUS, certificates, Kerberos or OIDC.

What port does OpenConnect use?

TCP 443 for login and the TLS tunnel, plus a UDP port for DTLS that the server announces in X-DTLS-Port. ocserv uses 443 for both by default.

Can OpenConnect connect to GlobalProtect or FortiGate?

Yes: --protocol=gp for GlobalProtect and --protocol=fortinet for FortiGate. The manual still marks every protocol except AnyConnect as experimental.

Can a firewall detect an ocserv server?

It can try two things: request the fixed tunnel path, and recognise the GnuTLS handshake. Camouflage hides the first, not the second. No published study has measured how censors detect it.

Does Veli support OpenConnect?

No. Veli does not connect OpenConnect or AnyConnect servers.