Page MenuHomeFreeBSD

certctl: Unstickify (un)trusted certificates
ClosedPublic

Authored by des on Apr 24 2026, 12:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 26, 10:21 AM
Unknown Object (File)
Tue, May 26, 10:13 AM
Unknown Object (File)
Tue, May 26, 7:51 AM
Unknown Object (File)
Tue, May 26, 12:50 AM
Unknown Object (File)
Mon, May 25, 8:29 AM
Unknown Object (File)
Mon, May 25, 8:21 AM
Unknown Object (File)
Mon, May 25, 1:02 AM
Unknown Object (File)
Mon, May 25, 1:00 AM
Subscribers

Details

Summary

Ever since certctl was rewritten in C, the rehash command has reingested
TRUSTDESTDIR / UNTRUSTDESTDIR in addition to TRUSTPATH / UNTRUSTPATH.
This seemed like a good idea at the time but was, in retrospect, a
mistake, as it means a (un)trusted certificate remains (un)trusted
forever (or at least until it expires) even if it is removed from
(UN)TRUSTPATH. Among other issues, it causes ports QA to fail for any
port that either installs certificates or depends on a port that does.

Although this behavior was undocumented, the change may surprise users
who have added certificates manually, so update the manual page to point
it out and add prominent warnings to the trust and untrust commands.

PR: 290078
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Apr 24 2026, 12:21 PM
des retitled this revision from certctl: Unstickify trusted certificates to certctl: Unstickify (un)trusted certificates.Apr 24 2026, 2:02 PM
des edited the summary of this revision. (Show Details)
bcr added a subscriber: bcr.

OK for the changes to the manpage.

This revision is now accepted and ready to land.Apr 25 2026, 8:24 AM
This revision now requires review to proceed.Apr 26 2026, 5:48 PM
usr.sbin/certctl/certctl.8
116

Reading the caveat here, I guess I'm wondering why untrust doesn't act as a slightly nicer shorthand for copying the cert into one of the default_untrusted_paths (probably the localbase one?) rather than accidentally presenting a footgun, since we do some implicit rehashes (e.g. when the trust store changes) that they may not be considering that will drop it.

usr.sbin/certctl/certctl.8
116

I'm torn between a) changing certctl untrust to doing just that and b) leaving the code as-is but documenting that as the preferred alternative.

don't switch to distrust yet

This revision is now accepted and ready to land.Tue, May 5, 7:54 PM
This revision was automatically updated to reflect the committed changes.