Repository navigation
Conversation
The root is name-constrained to the TLD it was made for, and Ensure kept loading it after the TLD changed, so browsers rejected every certificate for the new TLD even with the CA trusted. Ensure now makes a new CA when the existing one doesn't permit the TLD. Site certificates follow, since they are reissued when signed by another CA, and `flock install` trusts the new root because its trust checks go by fingerprint. Fixes flock-php#180
This branch has not been deployed
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.
Fixes #180
What and why
The local CA is name-constrained to the TLD it was created for, but
certs.Ensurekept loading the existing CA after the TLD changed, so every certificate for the new TLD was rejected even with the CA trusted.Ensurenow creates a new CA when the existing one's name constraints don't permit the configured TLD (a CA without constraints is kept). The rest follows from existing behavior:SiteCertchecks the signing CA, and in-memory leaves are keyed by CA fingerprint;flock installtrusts the new root, since the trust checks on macOS (verify-cert), Windows (certutil -store Root <fingerprint>) and Linux (anchor file comparison) all fail for it.The old root stays in the trust stores. It only covers the old TLD; removing it could be a follow-up if you want that.
How I tested it
TestReplacesCAWhenTheTLDChangesfails onmain("CA for .wsl was kept for .test") and passes with the change; plusTestKeepsCAWithoutNameConstraints.go testforinternal/certs,internal/web,internal/cli,internal/daemonon Windows;go vet,gofmt. I couldn't run-racelocally.Checklist
docs/, or no docs change is needed