Skip to content

Commit

Permalink
fix test expectation
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelandis committed Nov 13, 2023
1 parent 989e2e1 commit 3a8f9a5
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.nio.file.Path;
import java.security.SecureRandom;
import java.security.cert.CertPathBuilderException;
import java.security.cert.CertificateException;
import java.util.HashSet;
import java.util.List;

Expand Down Expand Up @@ -103,11 +104,13 @@ public void testThatHttpFailsWithoutSslClientAuth() throws IOException {
restClient.performRequest(new Request("GET", "/"));
fail("Expected SSLHandshakeException");
} catch (IOException e) {
Throwable t = ExceptionsHelper.unwrap(e, CertPathBuilderException.class);
assertThat(t, instanceOf(CertPathBuilderException.class));
if (inFipsJvm()) {
Throwable t = ExceptionsHelper.unwrap(e, CertificateException.class);
assertThat(t, instanceOf(CertificateException.class));
assertThat(t.getMessage(), containsString("Unable to find certificate chain"));
} else {
Throwable t = ExceptionsHelper.unwrap(e, CertPathBuilderException.class);
assertThat(t, instanceOf(CertPathBuilderException.class));
assertThat(t.getMessage(), containsString("unable to find valid certification path to requested target"));
}
}
Expand Down

0 comments on commit 3a8f9a5

Please sign in to comment.