Page MenuHomeVyOS Platform

OpenConnect with an ACME certificate: every certificate renewal stops ocserv and drops VPN sessions
Open, Requires assessmentPublicBUG

Description

Affected setup: a router that runs OpenConnect with an ACME certificate and has no load-balancing haproxy configured.

set pki certificate VPN acme domain-name vpn.example.com
set vpn openconnect ssl certificate VPN

When certbot renews the certificate, ocserv is now stopped and started instead of reloaded, so every connected client is dropped:

pre_hook = systemctl stop ocserv.service
systemd[1]: Stopping OpenConnect SSL VPN server...
systemd[1]: Stopped OpenConnect SSL VPN server.
systemd[1]: Started OpenConnect SSL VPN server.
renewal: same ocserv PID, session kept, tunnel ping
1.5.1            yes, sessions 1, 2/2 pings (2/2 runs)
rolling          new PID, sessions 0, 0/2 pings (0/2 runs)
1.5 branch       new PID, sessions 0 (0/3 runs)

1.5.1 logs Reloading OpenConnect SSL VPN server... / Reloaded ... for the same renewal.

Cause
T9531 tags the certificate as used by openconnect also when no haproxy is configured (src/conf_mode/pki.py). For every service in used_by, the certbot renew call adds --pre-hook "systemctl stop <service>". ocserv listens on 443, not on certbot's port 80, so stopping it is not needed.

Suggested fix
Add a pre-hook stop only for services that hold certbot's port (haproxy), and keep reloading ocserv after the renewal.

Details

Version
rolling, 1.5
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)