6894461: OCSP Checker should not wrap all Exception as "Unable to send OCSP request."(introduced by #6885667)
authormullan
Wed, 18 Nov 2009 12:34:26 -0500
changeset 4318 fdcb5ce9dc00
parent 4241 7d4f50f3806c
child 4322 6508d71adfd1
6894461: OCSP Checker should not wrap all Exception as "Unable to send OCSP request."(introduced by #6885667) Reviewed-by: vinnie, xuelei
jdk/src/share/classes/sun/security/provider/certpath/OCSPChecker.java
--- a/jdk/src/share/classes/sun/security/provider/certpath/OCSPChecker.java	Tue Nov 17 09:44:43 2009 +0000
+++ b/jdk/src/share/classes/sun/security/provider/certpath/OCSPChecker.java	Wed Nov 18 12:34:26 2009 -0500
@@ -335,10 +335,13 @@
             response = OCSP.check(Collections.singletonList(certId), uri,
                 responderCert, pkixParams.getDate());
         } catch (Exception e) {
-            // Wrap all exceptions in CertPathValidatorException so that
-            // we can fallback to CRLs, if enabled.
-            throw new CertPathValidatorException
-                ("Unable to send OCSP request", e);
+            if (e instanceof CertPathValidatorException) {
+                throw (CertPathValidatorException) e;
+            } else {
+                // Wrap exceptions in CertPathValidatorException so that
+                // we can fallback to CRLs, if enabled.
+                throw new CertPathValidatorException(e);
+            }
         }
 
         RevocationStatus rs = (RevocationStatus) response.getSingleResponse(certId);