Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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 @@ -7,6 +7,7 @@
import java.security.PublicKey;
import java.security.cert.CertPath;
import java.security.cert.CertPathValidator;
import java.security.cert.CertPathValidatorException;
import java.security.cert.Certificate;
import java.security.cert.CertificateFactory;
import java.security.cert.PKIXCertPathValidatorResult;
Expand Down Expand Up @@ -113,6 +114,10 @@ PublicKey verifyChainWithoutCaching(String[] certificates, boolean performRevoca
PKIXCertPathValidatorResult certPathValidatorResult = (PKIXCertPathValidatorResult) certPathValidator.validate(certPath, parameters);
return certPathValidatorResult.getPublicKey();
} catch (Exception e) {
// This indicates an OCSP network failure
if (e instanceof CertPathValidatorException && ((CertPathValidatorException) e).getReason() == CertPathValidatorException.BasicReason.UNDETERMINED_REVOCATION_STATUS) {
throw new VerificationException(VerificationStatus.RETRYABLE_VERIFICATION_FAILURE);
}
throw new VerificationException(VerificationStatus.INVALID_CHAIN, e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
public enum VerificationStatus {
OK,
VERIFICATION_FAILURE,
RETRYABLE_VERIFICATION_FAILURE,
INVALID_APP_IDENTIFIER,
INVALID_ENVIRONMENT,
INVALID_CERTIFICATE,
Expand Down
Loading