# HG changeset patch # User mullan # Date 1255528042 14400 # Node ID 7c72ce9392fcc5490ba169f12b34da7c6be24d6b # Parent d9543f5b7f717462bfcafd441f2a0e9b88e77142# Parent b2b2ee2ca90c430f8276bfd93e7ffd818af3fa3f Merge diff -r d9543f5b7f71 -r 7c72ce9392fc jdk/src/share/classes/sun/security/provider/certpath/OCSP.java --- a/jdk/src/share/classes/sun/security/provider/certpath/OCSP.java Tue Oct 13 17:34:48 2009 -0700 +++ b/jdk/src/share/classes/sun/security/provider/certpath/OCSP.java Wed Oct 14 09:47:22 2009 -0400 @@ -64,6 +64,8 @@ private static final Debug debug = Debug.getInstance("certpath"); + private static final int CONNECT_TIMEOUT = 15000; // 15 seconds + private OCSP() {} /** @@ -176,6 +178,8 @@ debug.println("connecting to OCSP service at: " + url); } HttpURLConnection con = (HttpURLConnection)url.openConnection(); + con.setConnectTimeout(CONNECT_TIMEOUT); + con.setReadTimeout(CONNECT_TIMEOUT); con.setDoOutput(true); con.setDoInput(true); con.setRequestMethod("POST"); diff -r d9543f5b7f71 -r 7c72ce9392fc jdk/src/share/classes/sun/security/provider/certpath/OCSPChecker.java --- a/jdk/src/share/classes/sun/security/provider/certpath/OCSPChecker.java Tue Oct 13 17:34:48 2009 -0700 +++ b/jdk/src/share/classes/sun/security/provider/certpath/OCSPChecker.java Wed Oct 14 09:47:22 2009 -0400 @@ -25,7 +25,6 @@ package sun.security.provider.certpath; -import java.io.IOException; import java.math.BigInteger; import java.util.*; import java.security.AccessController; @@ -335,10 +334,11 @@ (issuerCert, currCertImpl.getSerialNumberObject()); response = OCSP.check(Collections.singletonList(certId), uri, responderCert, pkixParams.getDate()); - } catch (IOException ioe) { - // should allow this to pass if network failures are acceptable + } 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", ioe); + ("Unable to send OCSP request", e); } RevocationStatus rs = (RevocationStatus) response.getSingleResponse(certId);