REF-16: Make CRLCheckerTest reliable (force OCSP POST, use a truly revoked cert, tag integration tests) - #90
Open
thomasnymand wants to merge 2 commits into
Open
Conversation
…ach the responder The JDK OCSP client uses the RFC 5019 GET form (request base64-encoded in the URL path) for small requests. The NemLog-in test OCSP responder at ca1.cti-gov.dk returns HTTP 404 for that GET form (it only serves POST), so CRLCheckerTest's OCSP validation failed with UNDETERMINED_REVOCATION_STATUS and dropped the otherwise-valid certificate. Set com.sun.security.ocsp.useget=false in BaseServiceTest.beforeAll so the JDK POSTs the OCSP request (request in the body) instead. Verified end-to-end that this makes the responder return "good" and the certificate validate. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…n tests Replace TestConstants.REVOKED_CERTIFICATE with a certificate that is actually revoked at the NemLog-in test CA (verified: OCSP reports "revoked" and the serial is present in the issuing CRL; valid 2026-07-06 .. 2029-07-05). The revoked OCSP/CRL tests now pass because the certificate is genuinely revoked, rather than incidentally due to an unreachable responder. Tag both testOcspCheckOnRevokedCertificate and testCrlCheckOnRevokedCertificate with @tag("integration") since they depend on the live test CA revocation infrastructure. No group filtering is configured, so they still run by default; the tag allows excluding them from offline runs via -DexcludedGroups=integration. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
Fixes the flaky/failing
CRLCheckerTestuncovered while reviewing the test suite.Problems
testOcspCheckOnValidCertificatefailed (expected: <1> but was: <0>). The JDK OCSP client uses the RFC 5019 GET form (request base64-encoded in the URL path) for small requests. The NemLog-in test OCSP responder atca1.cti-gov.dkreturns HTTP 404 for that GET form (it only serves POST), so validation failed withUNDETERMINED_REVOCATION_STATUSand the valid certificate was dropped.testOcspCheckOnRevokedCertificatereturned an empty set and happened to satisfy itsassertEquals(0, …)— i.e. it was green due to the network failure, not actual revocation. The revoked certificate's real status was never exercised.Changes
com.sun.security.ocsp.useget=falseinBaseServiceTest.beforeAll, so the JDK POSTs the OCSP request (request in body). Verified end-to-end that the responder then returnsgood/revokedand the cert path validates.TestConstants.REVOKED_CERTIFICATE. Verified against the live test CA: OCSP reportsrevokedand the serial is present in the issuing CRL. Validity 2026-07-06 .. 2029-07-05 (no near-term expiry).@Tag("integration")(both OCSP and CRL variants) since they depend on the live test-CA revocation infrastructure. No group filtering is configured, so they still run by default; the tag allows excluding them offline via-DexcludedGroups=integration.Verification
mvn -pl oiosaml clean test: all fourCRLCheckerTesttests pass (present, not skipped). The only remaining failure is the unrelatedOIOBPPUtilTest(JDK 26 JAXB incompatibility), which also fails onmaster.Notes
com.sun.security.ocsp.usegetis an OpenJDK/Oracle-internal property (sun.security.provider.certpath.OCSP); reliable on HotSpot-derived JVMs and JVM-global in scope.🤖 Generated with Claude Code