Skip to content

Commit bea39a1

Browse files
Shivangi Guptacoffeys
authored andcommitted
8373101: JdkClient and JdkServer test classes ignore namedGroups field
Backport-of: 1ae4a6c43ea21d4b147bcfcfaf1484c6e618dce5
1 parent e005c0e commit bea39a1

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

test/jdk/javax/net/ssl/TLSCommon/interop/JdkClient.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
2525
import java.net.InetSocketAddress;
2626
import java.net.SocketException;
2727
import java.util.ArrayList;
28+
import java.util.Arrays;
2829
import java.util.List;
2930

3031
import javax.net.ssl.SNIHostName;
@@ -86,6 +87,16 @@ protected void configClientSocket(Builder builder) throws SocketException {
8687
if (builder.getAppProtocols() != null) {
8788
sslParams.setApplicationProtocols(builder.getAppProtocols());
8889
}
90+
91+
NamedGroup[] namedGroups = builder.getNamedGroups();
92+
if (namedGroups != null
93+
&& namedGroups.length > 0) {
94+
String[] namedGroupStrs = Arrays.stream(namedGroups)
95+
.map(NamedGroup::name)
96+
.toArray(String[]::new);
97+
sslParams.setNamedGroups(namedGroupStrs);
98+
}
99+
89100
socket.setSSLParameters(sslParams);
90101
}
91102

test/jdk/javax/net/ssl/TLSCommon/interop/JdkServer.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -22,9 +22,9 @@
2222
*/
2323

2424
import java.io.IOException;
25-
import java.net.InetAddress;
2625
import java.net.SocketException;
2726
import java.util.ArrayList;
27+
import java.util.Arrays;
2828
import java.util.List;
2929

3030
import javax.net.ssl.SNIHostName;
@@ -85,6 +85,16 @@ protected void configServerSocket(Builder builder) throws SocketException {
8585
System.out.println("appProtocol: " + appProtocol);
8686
}
8787
}
88+
89+
NamedGroup[] namedGroups = builder.getNamedGroups();
90+
if (namedGroups != null
91+
&& namedGroups.length > 0) {
92+
String[] namedGroupStrs = Arrays.stream(namedGroups)
93+
.map(NamedGroup::name)
94+
.toArray(String[]::new);
95+
sslParams.setNamedGroups(namedGroupStrs);
96+
}
97+
8898
serverSocket.setSSLParameters(sslParams);
8999
}
90100

0 commit comments

Comments
 (0)