docs(CertificateManager/ICertificateManager): clarify API - #60363
Open
joshtrichards wants to merge 7 commits into
Open
docs(CertificateManager/ICertificateManager): clarify API#60363joshtrichards wants to merge 7 commits into
joshtrichards wants to merge 7 commits into
Conversation
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
joshtrichards
marked this pull request as ready for review
May 13, 2026 18:47
joshtrichards
requested review from
CarlSchwan,
artonge,
blizzz,
icewind1991,
leftybournes,
provokateurin and
salmart-dev
and removed request for
a team
May 13, 2026 18:47
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
| * Rebuild the generated effected certificate bundle from: | ||
| * - uploaded certificates | ||
| * - the shipped default CA bundle | ||
| * - the current system CA bundle, if present and different from the target |
Member
There was a problem hiding this comment.
Either this is not true or I don't understand what you mean. Nextcloud never uses the system CA bundle.
Member
Author
There was a problem hiding this comment.
Good catch. I traced this further and realized I had confused two different things (and inadvertently also discovered some dead code):
server/lib/private/Security/CertificateManager.php
Lines 133 to 138 in 6a2d392
- The existing comment on line 133 refers to the Nextcloud system-wide bundle, not the host system CA bundle.
- This bit of code is a relic of the formerly supported per-user bundle model (which was dropped in Improve CertificateManager to not be user context dependent #21693).
- Since Improve CertificateManager to not be user context dependent #21693, the code in the conditional that follows that comment is dead code.
I’ll remove the inaccurate wording from this PR, along with the stale comment and unreachable code in the implementation.
CarlSchwan
reviewed
Jun 8, 2026
| * Rebuild the generated effected certificate bundle from: | ||
| * - uploaded certificates | ||
| * - the shipped default CA bundle | ||
| * - the current system CA bundle, if present and different from the target |
Member
There was a problem hiding this comment.
Suggested change
| * - the current system CA bundle, if present and different from the target |
Remove the obsolete system-wide bundle append left over from the former per-user certificate-bundle model. Since #21693 consolidated certificate handling to a single Nextcloud-wide bundle, the append condition can no longer be satisfied. Clarify the implementation terminology around uploaded certificates and the configured default CA bundle, and remove redundant exception handling in addCertificate(). Also close directory handles on all paths and use str_contains() when checking uploaded certificate contents so a PEM header at offset zero is handled correctly. Signed-off-by: Josh <josh.t.richards@gmail.com>
Document the distinction between uploaded trusted certificates, the generated certificate bundle, and the configured default CA bundle. Clarify that listCertificates() returns only uploaded certificates, getCertificateBundle() returns a virtual filesystem path, and getAbsoluteBundlePath() may fall back to the configured default CA bundle. Remove the obsolete reference to a separate system bundle being appended. Signed-off-by: Josh <josh.t.richards@gmail.com>
Document that default_certificates_bundle_path overrides Nextcloud's shipped CA bundle used to verify TLS certificates. Clarify that the configured value must reference a readable local CA bundle, is used directly when no certificates are uploaded, and is included when Nextcloud generates the bundle containing uploaded certificates. Simplify the default value and use the Debian-derived system CA bundle path as the configuration-sample example for further clarity. Signed-off-by: Josh <josh.t.richards@gmail.com>
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.
Summary
Clarify and align the
CertificateManagerimplementation andICertificateManagerpublic contract around uploaded certificates, generated bundles, and the configured default CA bundle.This also removes obsolete code from the former per-user certificate-bundle model, which was removed in #21693.
Changes
getCertificateBundle()returns a virtual filesystem path and thatgetAbsoluteBundlePath()may fall back to the configured default CA bundle.CertificateManager::createCertificateBundle()helper private. It was already outside the interface and is only used internally.createCertificateBundle().config.sample.phpentry fordefault_certificates_bundle_pathfor alignment and improved clarity.TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)