Description
As evidenced by #52094 and #51599, there are issues with relying on third-party services for testing the platform verifier implementations. Ideally we'd run these tests entirely locally, but this requires mutating the trust store on the systems being tested.
While we absolutely cannot start inserting arbitrary certificates into the trust stores of developers, it may be reasonable to do this on the trybots (although there will still be some gaps here, since user added roots are always going to be treated somewhat differently than roots the system chooses to trust.)
We should still have some kind of local testing that doesn't rely on trust store mutation though, perhaps just retaining the existing badssl.com based tests but gating them behind a flag?
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Activity
gopherbot commentedon Apr 2, 2022
Change https://go.dev/cl/397694 mentions this issue:
crypto/x509: local platform verifier tests on trybots
gopherbot commentedon May 12, 2022
Change https://go.dev/cl/405914 mentions this issue:
crypto/x509: attempt to prime windows root pool before hybrid test
crypto/x509: attempt to prime windows root pool before hybrid test
x509: certificate signed by unknown authority
#51599bcmills commentedon Jun 14, 2022
2022-06-06T18:37:38-fc97075/windows-amd64-longtest has another failure due to
badssl.com
having a cert that is bad in the wrong kind of way:WSATRY_AGAIN
#55050rolandshoemaker commentedon Dec 21, 2022
The least worst option I can think of: we insert a static certificate into the builder images for macos and windows, and use it to sign local certificates. For testing on local systems, we provide a very scary flag the user can pass that will generate an ephemeral key/cert pair and attempt to insert it into the trust store for the duration of the testing, removing it when done.
This should get us the best of both worlds, with only minor pain.
rolandshoemaker commentedon Apr 17, 2023
Plan is: basically above. We'll generate a highly constrained root, which will be used for testing. Rather than a flag that lets the user insert it into their own pool, we'll simply add it to the tree and allow users to insert it into their own trust pool if they wish.
We'll add a wrapper to the platform tests which decide whether or not to run them based on the detectable presence of the constraint root, this way they'll run on developers systems who want to test them, and it'll require at least some knowledge of trust stores in order to add it (rather than simply passing a flag and not really knowing what you're getting yourself into).
I'll implement the sniffing + tests etc first, and once that has landed and we have a root in the tree, we'll pass this on to the release team to add to the builder images.
gopherbot commentedon Apr 25, 2023
Change https://go.dev/cl/488855 mentions this issue:
crypto/x509: use synthetic root for platform testing
25 remaining items
rolandshoemaker commentedon Dec 11, 2023
Based on the LUCI results, I am under the impression the test root has only been added to the TryBot builders, but not the LUCI builders (which show the skip message because the test root cannot be found). Is there a timeline for adding them to the LUCI ones as well?
I think we could probably can delete the old tests now, but if we are only running the LUCI builders then these tests wont be exercised at all, which is probably not ideal.
cc @cagedmantis
dmitshur commentedon Dec 22, 2023
As an update, test results here show the new test is running (not skipping) and passing on the recent windows/arm64 LUCI builder (#64587).
crypto/x509: remove TestPlatformVerifierLegacy tests
gopherbot commentedon May 16, 2024
Change https://go.dev/cl/586215 mentions this issue:
[release-branch.go1.21] crypto/x509: remove TestPlatformVerifierLegacy tests
gopherbot commentedon May 16, 2024
Change https://go.dev/cl/586235 mentions this issue:
[release-branch.go1.22] crypto/x509: remove TestPlatformVerifierLegacy tests
[release-branch.go1.21] crypto/x509: remove TestPlatformVerifierLegac…
[release-branch.go1.22] crypto/x509: remove TestPlatformVerifierLegac…