[jdk11u-dev] RFR: 8209362: sun/security/ssl/SSLSocketImpl/ReuseAddr.java failed due to "BindException: Address already in use (Bind failed)"

Antonio Vieiro avieiro at openjdk.org
Thu Feb 12 11:37:56 UTC 2026


Backport of [JDK-8209362](https://bugs.openjdk.org/browse/JDK-8209362) to JDK11.

This is the first of a series of backports to convert the interface `SSLContextTemplate.java` in JDK11 to an abstract class as in JDK17, with the objective of making future backports easier, [as discussed earlier](https://github.com/openjdk/jdk11u-dev/pull/3136#pullrequestreview-3747461154).

The change converts `private void doClientSide()` in `SSLSocketTemplate.java` to a `protected` method (as [`doServerSide()` is](https://github.com/openjdk/jdk11u-dev/blob/9ba9b672913e88b857d671d0b9458753418aff16/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java#L233)), paving the way to move `SSLSocketTemplate.java` internals into `SSLContextTemplate.java` in subsequent backports.

As a side effect the `test/jdk/sun/security/ssl/SSLSocketImpl/ReuseAddr.java` test is greatly simplified by using the `SSLSocketTemplate` base class.

All security tests pass:


==============================
Test summary
==============================
   TEST                                              TOTAL  PASS  FAIL ERROR   
   jtreg:test/jdk:jdk_security                        1361  1361     0     0   
==============================
TEST SUCCESS


Including the modified test:

==============================
Test summary
==============================
   TEST                                              TOTAL  PASS  FAIL ERROR   
   jtreg:test/jdk/sun/security/ssl/SSLSocketImpl/ReuseAddr.java
                                                         1     1     0     0   
==============================
TEST SUCCESS

-------------

Commit messages:
 - Backport 1f3d71b6205a9b9f473b14e6848db2d49d59110d

Changes: https://git.openjdk.org/jdk11u-dev/pull/3150/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk11u-dev&pr=3150&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8209362
  Stats: 225 lines in 2 files changed: 1 ins; 210 del; 14 mod
  Patch: https://git.openjdk.org/jdk11u-dev/pull/3150.diff
  Fetch: git fetch https://git.openjdk.org/jdk11u-dev.git pull/3150/head:pull/3150

PR: https://git.openjdk.org/jdk11u-dev/pull/3150


More information about the jdk-updates-dev mailing list