Repository navigation
fix: do not append the system certificate bundle to itself - #41956
Merged
Merged
Conversation
createCertificateBundle() appends the system bundle to every bundle it writes, including the system bundle itself. On local storage that reads back what was just written, so ca-bundle.crt ends up in it twice. On object storage the write is uploaded only on fclose(), so the read returns the previous bundle: removed roots stay trusted and the bundle grows with every regeneration. UpdateCertificateStoreTest fails on S3 because of this. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com>
phil-davis
approved these changes
Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
CertificateManager::createCertificateBundle()appends the system bundle to every bundle it writes, including the system bundle itself. It opensfiles_external/rootcerts.crtfor writing and then reads the same path back:ca-bundle.crtends up in the system bundle twice.'w'stream is uploaded only onfclose(), so the read returns the previous bundle. The regenerated bundle is the fresh roots plus the whole old bundle. Roots that an update removed (fix: update ca-bundle.crt #41908) stay trusted, and the file grows with every regeneration.The system bundle now skips that append. User bundles still include the system bundle.
Related
#41910 added
UpdateCertificateStoreTest::testRunRegeneratesSystemBundle, which catches this on S3. It fails in owncloud/reusable-workflows' "PHP Unit with Ceph S3" jobs (for example on owncloud/reusable-workflows#106):…stale' does not contain "stale". Core's own CI runs no PHPUnit on object storage, which is why #41910 merged green.How Has This Been Tested?
In
owncloudci/php:8.3, with sqlite:testCreateSystemBundleDoesNotIncludeItselffails on master (2 is identical to 1) and passes with the fix.files_primary_s3as primary storage on a Scality S3 server: on master, both the new test andtestRunRegeneratesSystemBundlefail with the same output as the Ceph CI jobs. With the fix,CertificateManagerTest(13) andUpdateCertificateStoreTest(4) pass.Known gap, not fixed here
A user bundle copies in the system bundle as it is on disk and does not refresh it first. If
ca-bundle.crtchanges withoutocc upgradeormaintenance:repairrunning, a rebuilt user bundle still carries the old system bundle's roots. #41910's repair step covers the upgrade path, because it regenerates the system bundle first. This will be handled in a separate PR.Types of changes
🤖 Generated with Claude Code