JSSE: SSLServerSocketTest: only add SSLServerSocketFactory to be tested if has enabled protocols available

pull/153/head
Chris Conlon 2023-10-12 16:10:18 -06:00
parent f6ca65ccc1
commit a31aaa6f62
1 changed files with 9 additions and 1 deletions

View File

@ -154,7 +154,15 @@ public class WolfSSLServerSocketTest {
ctx.init(km.getKeyManagers(), tm.getTrustManagers(), null);
SSLServerSocketFactory sf = ctx.getServerSocketFactory();
sockFactories.add(sf);
/* Only add SSLSocketFactory if it has enabled protocols. JDK
* configuration of 'jdk.tls.disabledAlgorithms' can turn off
* protocols such as 'TLS 1.1' leaving a factory with none
* available */
SSLServerSocket s = (SSLServerSocket)sf.createServerSocket(0);
if (s.getEnabledProtocols().length > 0) {
sockFactories.add(sf);
}
}
}