Certificate Denylist
Devices often have no reliable clock, so certificate expiry and revocation dates cannot be trusted. A denylist lets you stop trusting a certificate anyway. Pantavisor refuses an HTTPS connection to Pantacor Hub when the certificate chain contains a listed certificate, whether it is the server certificate, an intermediate or a root.
Write the list
The file has one entry per line: the lowercase hex SHA-256 of a certificate's public key. Because the key is listed, a re-issued certificate with the same key is blocked too. Empty lines and # comments are ignored. Lines that are not a SHA-256 are logged and skipped.
Get the entry for a certificate with:
openssl x509 -in cert.pem -pubkey -noout | openssl pkey -pubin -outform DER | sha256sum | cut -d' ' -f1
# GlobalSign Root E46, shown as an example only
e04a022ce32f4ccf2c7f6046287b828a32a909f5e751447f83fd2c71f6fd8173
Pantavisor reads the file from /etc/thttp/denylist unless you point PV_LIBTHTTP_DENYLIST at another path. A missing file means no denylist. Keep the file outside the certificates directory (PV_LIBTHTTP_CERTSDIR).
Set the path
PV_LIBTHTTP_DENYLIST can be set at these levels: pantavisor.config, policy, OEM config, pv_ kernel command line and environment variable. It cannot be set from pantahub.config, which holds only the credentials and Hub settings the device negotiates at run time.
For example, in pantavisor.config:
PV_LIBTHTTP_DENYLIST=/storage/my-denylist
Or in the OEM config file of a revision, so an update can move the path:
mkdir -p myoem
echo 'PV_LIBTHTTP_DENYLIST=/storage/my-denylist' >> myoem/default.config
pvr add . && pvr commit && pvr post
On the kernel command line the pv_ prefix is stripped before the key is looked up, so the full key follows it: pv_PV_LIBTHTTP_DENYLIST=/storage/my-denylist. Prefer an environment variable.
When a change takes effect
Pantavisor reads the file once at start-up, so a changed list or path takes effect after a reboot. A revision that changes the OEM config file is applied with a reboot, so the new path is used when the device comes back. Editing the list file itself, for example on /storage, needs a manual reboot:
pvcontrol commands reboot "new denylist"
Check it
At start-up, Pantavisor logs one of these lines:
loaded 2 certificate denylist entries from /etc/thttp/denylist
no certificate denylist at /etc/thttp/denylist
Find them in the Pantavisor log:
grep denylist /storage/logs/current/pantavisor/pantavisor.log
When a listed certificate is in the chain, requests to the Hub fail without an answer and the device stays offline. The remote/core/hub-certificate-denylist test exercises this against a Hub.
Reference
- Configuration —
PV_LIBTHTTP_DENYLIST, with its levels