@@ -655,6 +655,17 @@ private static void setProperties(Properties props) {
655655 // SSL property "javax.net.ssl.keyStore" set at the JVM level via system properties.
656656 System .setProperty ("javax.net.ssl.keyStore" , keyStore );
657657 }
658+ String jdkTlsNamedGroups = restricts .jdkTlsNamedGroups ;
659+ if (!isNullOrBlank (jdkTlsNamedGroups )) {
660+ String namedGroups = System .getProperty ("jdk.tls.namedGroups" );
661+ if (namedGroups == null ) {
662+ // TLS property "jdk.tls.namedGroups" set at the JVM level via system properties.
663+ System .setProperty ("jdk.tls.namedGroups" , jdkTlsNamedGroups );
664+ } else {
665+ printStackTraceAndExit ("System property jdk.tls.namedGroups cannot be set"
666+ + " when defined in a RestrictedSecurity profile" );
667+ }
668+ }
658669 }
659670
660671 /**
@@ -800,6 +811,7 @@ private static final class RestrictedSecurityProperties {
800811 private final String jdkTlsDisabledAlgorithms ;
801812 private final String jdkTlsEphemeralDHKeySize ;
802813 private final String jdkTlsLegacyAlgorithms ;
814+ private final String jdkTlsNamedGroups ;
803815 private final String jdkCertpathDisabledAlgorithms ;
804816 private final String jdkSecurityLegacyAlgorithms ;
805817 private final String keyStoreType ;
@@ -834,6 +846,7 @@ private RestrictedSecurityProperties(String profileID, ProfileParser parser) {
834846 this .jdkTlsDisabledAlgorithms = parser .getProperty ("jdkTlsDisabledAlgorithms" );
835847 this .jdkTlsEphemeralDHKeySize = parser .getProperty ("jdkTlsEphemeralDHKeySize" );
836848 this .jdkTlsLegacyAlgorithms = parser .getProperty ("jdkTlsLegacyAlgorithms" );
849+ this .jdkTlsNamedGroups = parser .getProperty ("jdkTlsNamedGroups" );
837850 this .jdkCertpathDisabledAlgorithms = parser .getProperty ("jdkCertpathDisabledAlgorithms" );
838851 this .jdkSecurityLegacyAlgorithms = parser .getProperty ("jdkSecurityLegacyAlgorithms" );
839852 this .keyStoreType = parser .getProperty ("keyStoreType" );
@@ -1128,6 +1141,7 @@ private void listUsedProfile() {
11281141 printProperty (profileID + ".tls.disabledAlgorithms: " , jdkTlsDisabledAlgorithms );
11291142 printProperty (profileID + ".tls.ephemeralDHKeySize: " , jdkTlsEphemeralDHKeySize );
11301143 printProperty (profileID + ".tls.legacyAlgorithms: " , jdkTlsLegacyAlgorithms );
1144+ printProperty (profileID + ".tls.namedGroups: " , jdkTlsNamedGroups );
11311145 printProperty (profileID + ".jce.certpath.disabledAlgorithms: " , jdkCertpathDisabledAlgorithms );
11321146 printProperty (profileID + ".jce.legacyAlgorithms: " , jdkSecurityLegacyAlgorithms );
11331147 System .out .println ();
@@ -1582,6 +1596,8 @@ private void loadProperties(String profileID, List<String> allInfo) {
15821596 profileID + ".tls.ephemeralDHKeySize" , allInfo );
15831597 setProperty ("jdkTlsLegacyAlgorithms" ,
15841598 profileID + ".tls.legacyAlgorithms" , allInfo );
1599+ setProperty ("jdkTlsNamedGroups" ,
1600+ profileID + ".tls.namedGroups" , allInfo );
15851601 setProperty ("jdkCertpathDisabledAlgorithms" ,
15861602 profileID + ".jce.certpath.disabledAlgorithms" , allInfo );
15871603 setProperty ("jdkSecurityLegacyAlgorithms" ,
0 commit comments