Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http-netty: Fix flaky SslAndNonSslConnectionsTest #2755

Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
import org.junit.jupiter.api.Test;
import org.mockito.stubbing.Answer;

import java.io.IOException;
import java.net.InetAddress;
import java.nio.channels.ClosedChannelException;
import java.security.cert.CertificateException;
import javax.annotation.Nullable;
import javax.net.ssl.SSLHandshakeException;
Expand Down Expand Up @@ -137,7 +137,7 @@ void nonSecureClientToSecureServerClosesConnection() throws Exception {
assert secureServerCtx != null;
try (BlockingHttpClient client = HttpClients.forSingleAddress(serverHostAndPort(secureServerCtx))
.buildBlocking()) {
assertThrows(ClosedChannelException.class, () -> client.request(client.get("/")));
assertThrows(IOException.class, () -> client.request(client.get("/")));
}
}

Expand All @@ -148,7 +148,7 @@ void secureClientToNonSecureServerClosesConnection() throws Exception {
.sslConfig(new ClientSslConfigBuilder(DefaultTestCerts::loadServerCAPem)
.peerHost(serverPemHostname()).build())
.buildBlocking()) {
assertThrows(ClosedChannelException.class, () -> client.request(client.get("/")));
assertThrows(IOException.class, () -> client.request(client.get("/")));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.nio.channels.ClosedChannelException;

/**
* {@link ClosedChannelException} that will not not fill in the stacktrace but use a cheaper way of producing
* {@link ClosedChannelException} that will not fill in the stacktrace but use a cheaper way of producing
* limited stacktrace details for the user.
*/
public final class StacklessClosedChannelException extends ClosedChannelException {
Expand Down
Loading