Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Improve certificate revocation checking #2626

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,23 @@ protected CertPath checkChainTrusted( CertSelector selector, X509Certificate...
pathBuilder = CertPathBuilder.getInstance( "PKIX" );
}

if (checkRevocation) {
// Configure revocation checking - using default OCSP preference (OCSP before CRL)
PKIXRevocationChecker revChecker = (PKIXRevocationChecker)pathBuilder.getRevocationChecker();
revChecker.setOptions(EnumSet.of(
// Only verify revocation status of end-entity (leaf) certificates
// This avoids issues with chains where the root certificate isn't included
// in the chain (e.g. Let's Encrypt) and its CRL distribution point isn't accessible
PKIXRevocationChecker.Option.ONLY_END_ENTITY,

// Continue validation if revocation information is unavailable
// This prevents failures when OCSP/CRL servers are unreachable or
// when revocation information isn't available for some certificates
PKIXRevocationChecker.Option.SOFT_FAIL
));
parameters.addCertPathChecker(revChecker);
guusdk marked this conversation as resolved.
Show resolved Hide resolved
}

try
{
// Finally, construct (and implicitly validate) the certificate path.
Expand Down
Loading