|
4 | 4 | import java.io.IOException; |
5 | 5 | import java.io.InputStream; |
6 | 6 | import java.lang.ref.WeakReference; |
7 | | -import java.net.HttpURLConnection; |
8 | 7 | import java.net.URI; |
| 8 | +import java.net.URLConnection; |
9 | 9 | import java.security.cert.CRL; |
10 | 10 | import java.security.cert.CRLException; |
11 | 11 | import java.security.cert.CertificateFactory; |
@@ -54,7 +54,7 @@ static synchronized PKIXCRLStore getCrl(CertificateFactory certFact, Date validD |
54 | 54 | if (crlStore != null) |
55 | 55 | { |
56 | 56 | boolean isExpired = false; |
57 | | - for (Iterator it = crlStore.getMatches(null).iterator(); it.hasNext();) |
| 57 | + for (Iterator it = crlStore.getMatches(null).iterator(); it.hasNext(); ) |
58 | 58 | { |
59 | 59 | X509CRL crl = (X509CRL)it.next(); |
60 | 60 |
|
@@ -125,11 +125,12 @@ private static Collection getCrlsFromLDAP(CertificateFactory certFact, URI distr |
125 | 125 | private static Collection getCrls(CertificateFactory certFact, URI distributionPoint) |
126 | 126 | throws IOException, CRLException |
127 | 127 | { |
128 | | - HttpURLConnection crlCon = (HttpURLConnection)distributionPoint.toURL().openConnection(); |
129 | | - crlCon.setConnectTimeout(DEFAULT_TIMEOUT); |
130 | | - crlCon.setReadTimeout(DEFAULT_TIMEOUT); |
| 128 | + URLConnection urlConnection = distributionPoint.toURL().openConnection(); |
131 | 129 |
|
132 | | - InputStream crlIn = crlCon.getInputStream(); |
| 130 | + urlConnection.setConnectTimeout(DEFAULT_TIMEOUT); |
| 131 | + urlConnection.setReadTimeout(DEFAULT_TIMEOUT); |
| 132 | + |
| 133 | + InputStream crlIn = urlConnection.getInputStream(); |
133 | 134 |
|
134 | 135 | Collection crls = certFact.generateCRLs(crlIn); |
135 | 136 |
|
|
0 commit comments