Update certificate dirs and file names on FreeBSD #43
+11
−3
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.
FreeBSD contains a canonical certstore managed by certctl(8) since 12.2 located in the base system (/etc/ssl), search there first. Alternatively, a user can populate a custom store in distbase (/usr/local/etc/ssl) with certctl(8) which shall be queried if the former does not exist. At last, there is a store for OpenSSL from the ports (/usr/local/openssl) outside of certctl(8)'s reach. Within these there can be also a bundle in parallel to a hashed directory.
This fixes #20 and fixes #37
FreeBSD port maintainer here.
Improvement on top of @djc's work:
certctl(8)'s introduction on FreeBSD 12.2 make life much easier.CERTIFICATE_DIRSuses those two from it. Additionally fromsecurity/openssl*./usr/local/share/certsis a source forcertlctl(8)which ends up in either of them, thus would lead to duplicates. ExtendedCERTIFICATE_FILE_NAMESby those files created bycertctl(8)from FreeBSD 15+ or ultimately for those who still installsecurity/ca_root_nsswhich is included in/usr/share/certs/trustedanyway.Sample code:
Verification in a standalone application while removing and adding potential candidates:
Running against publically available servers as well as in-house with enterprise CA structure.