On Tue, 10 Jan 2023 06:02:29 GMT, Jamil Nimeh <jni...@openjdk.org> wrote:
> This fixes an issue where HTTP responses that do not have an explicit > Content-Length are causing an EOFException which unravels into a > CertPathValidatorException during validations that involve OCSP checks. > > - JBS: https://bugs.openjdk.org/browse/JDK-8296343 test/jdk/sun/security/provider/certpath/OCSP/OCSPNoContentLength.java line 146: > 144: > 145: // Wait 5 seconds for server ready > 146: for (int i = 0; (i < 100 && !rootOcsp.isServerReady()); i++) { This pattern is repeated over 20 times in the code. Instead of spinning on a boolean, the SimpleOCSPServer class could use a CountdownLatch to signal when it's ready. Then, instead of having an `isServerReady()` method, it would just have a method e.g., `boolean waitForServer(long timeout, TimeUnit unit)` which just delegates to `CountdownLatch.await(long, TimeUnit)`. And to avoid changing 20+ other tests, just mark `isServerReady()` as deprecated. ------------- PR: https://git.openjdk.org/jdk/pull/11917