]> git.proxmox.com Git - pve-http-server.git/commit
fix #4802: reduce CA lookups while proxying
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 3 Jul 2023 07:18:51 +0000 (09:18 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 3 Jul 2023 07:35:30 +0000 (09:35 +0200)
commit91787a2003fe3d367a304ff66232b8b5cc2159a4
treee3bc01aaf55218a1ac4a5d729e7cfa935d28edae
parent9a43feac82d2687c1d7bbe12b381c09d1418ac0c
fix #4802: reduce CA lookups while proxying

OpenSSL as packaged in Debian bookworm now ships a compat symlink for
the "combined" CA certificates file (CAfile) as managed by
update-ca-certificates. This symlink is in addition to the CApath
one that has been around for a file. The new symlink in turn gets
picked up by openssl-using code that uses the default values for the
trust store.

Every TLS context initialization now reads the full combined file,
even if no TLS is actually employed on a connection. We do such an
initialization for every proxied connection (where our HTTP server is
the client).

By specifying an explicit CA path (that is identical to the default
one), the old behaviour of looking up each CA certificate
individually iff needed is enabled again.

For an API endpoint where HTTP request handling is the bottle neck
(as opposed to the actual API handler), this improves performance of
proxied requests to be back in line with unproxied ones handled
directly by the unprivileged daemon. For all proxied requests, CPU
usage is decreased as well.

The default CAfile and CApath contain the same certificates, so there
should be no change in trusted certificates. Additionally,
certificate fingerprints are pinned in this context and verified
against the cache of pinned fingerprints.

Reported-by: Roland Kletzing <roland.kletzing@cybercon.de>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
src/PVE/APIServer/AnyEvent.pm