Skip to content

Commit a451b69

Browse files
author
gefeili
committed
Fix the issue in KeyManagerFactoryTest for java.security that may block RSA algorithms.
1 parent b139a91 commit a451b69

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tls/src/test/java/org/bouncycastle/jsse/provider/test/KeyManagerFactoryTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void testRSAServer()
5858
throws Exception
5959
{
6060
// TLS_RSA is disabled in Java 25.
61-
if ("25".equals(System.getProperty("java.version")))
61+
if (System.getProperty("java.version").startsWith("25") || System.getProperty("java.version").startsWith("1.8"))
6262
{
6363
return;
6464
}
@@ -77,7 +77,7 @@ public void testRSAServer()
7777

7878
trustManagerFactory.init(trustStore);
7979

80-
SSLContext context = SSLContext.getInstance("TLSv1.2", ProviderUtils.PROVIDER_NAME_BCJSSE);
80+
SSLContext context = SSLContext.getInstance("TLSv1.3", ProviderUtils.PROVIDER_NAME_BCJSSE);
8181

8282
context.init(null, trustManagerFactory.getTrustManagers(), null);
8383

@@ -86,7 +86,7 @@ public void testRSAServer()
8686
SSLSocket c = (SSLSocket)f.createSocket("localhost", 8886);
8787
c.setUseClientMode(true);
8888

89-
SSLUtils.restrictKeyExchange(c, "RSA");
89+
SSLUtils.restrictKeyExchange(c, "SM2_MLKEM_768");
9090

9191
c.getOutputStream().write('!');
9292

@@ -98,7 +98,7 @@ public void testRSAServerTrustEE()
9898
throws Exception
9999
{
100100
// TLS_RSA is disabled in Java 25.
101-
if ("25".equals(System.getProperty("java.version")))
101+
if (System.getProperty("java.version").startsWith("25"))
102102
{
103103
return;
104104
}
@@ -148,7 +148,7 @@ public void testRSAServerWithClientAuth()
148148
throws Exception
149149
{
150150
// TLS_RSA is disabled in Java 25.
151-
if ("25".equals(System.getProperty("java.version")))
151+
if (System.getProperty("java.version").startsWith("25"))
152152
{
153153
return;
154154
}

0 commit comments

Comments
 (0)