Skip to content

Commit

Permalink
8271560: sun/security/ssl/DHKeyExchange/LegacyDHEKeyExchange.java sti…
Browse files Browse the repository at this point in the history
…ll fails due to "An established connection was aborted by the software in your host machine"

Backport-of: f18c0fac11aac833edfdc484e221518c55daa9a7
  • Loading branch information
thejasviv authored and Sibabrata Sahoo committed Sep 9, 2021
1 parent 271403b commit ea6e678
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/jdk/sun/security/ssl/DHKeyExchange/LegacyDHEKeyExchange.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
* @run main/othervm -Djdk.tls.ephemeralDHKeySize=legacy LegacyDHEKeyExchange
*/

import javax.net.ssl.SSLException;
import javax.net.ssl.SSLHandshakeException;
import javax.net.ssl.SSLSocket;
import java.net.SocketException;
import java.util.concurrent.CountDownLatch;

public class LegacyDHEKeyExchange extends SSLSocketTemplate{
Expand All @@ -53,6 +55,10 @@ protected void runServerApplication(SSLSocket socket) throws Exception {
throw she;
}
System.out.println("Expected exception thrown in server");
} catch (SSLException | SocketException se) {
// The client side may have closed the socket.
System.out.println("Server exception:");
se.printStackTrace(System.out);
} finally {
connDoneLatch.countDown();
connDoneLatch.await();
Expand All @@ -75,6 +81,10 @@ protected void runClientApplication(SSLSocket socket) throws Exception {
throw she;
}
System.out.println("Expected exception thrown in client");
} catch (SSLException | SocketException se) {
// The server side may have closed the socket.
System.out.println("Client exception:");
se.printStackTrace(System.out);
} finally {
connDoneLatch.countDown();
connDoneLatch.await();
Expand Down

1 comment on commit ea6e678

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.