Skip to content

Commit

Permalink
OWS-605: Conditionally check for user security policy
Browse files Browse the repository at this point in the history
  • Loading branch information
janakmulani committed Feb 9, 2023
1 parent 011d7c5 commit a96ed67
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public interface ConfigurationConstants {

String KEY_USER_SECURITY_POLICY = "deployment.user.security.policy";

String KEY_USER_SECURITY_POLICY_CHECK = "deployment.user.security.policy.check";

String KEY_USER_TRUSTED_CA_CERTS = "deployment.user.security.trusted.cacerts";

String KEY_USER_TRUSTED_JSSE_CA_CERTS = "deployment.user.security.trusted.jssecacerts";
Expand Down
5 changes: 5 additions & 0 deletions core/src/main/java/net/sourceforge/jnlp/config/Defaults.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ public class Defaults {
"file://" + JAVA_POLICY.getDefaultFullPath(),
ValidatorFactory.createUrlValidator()
),
Setting.createDefault(
ConfigurationConstants.KEY_USER_SECURITY_POLICY_CHECK,
String.valueOf(true),
ValidatorFactory.createBooleanValidator()
),
Setting.createDefault(
ConfigurationConstants.KEY_USER_TRUSTED_CA_CERTS,
USER_CACERTS.getDefaultFullPath(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ protected JNLPPolicy() {
systemPolicy = Policy.getPolicy();

systemJnlpPolicy = getPolicyFromConfig(ConfigurationConstants.KEY_SYSTEM_SECURITY_POLICY);
userJnlpPolicy = getPolicyFromUrl(PathsAndFiles.JAVA_POLICY.getFullPath());

if (Boolean.parseBoolean(JNLPRuntime.getConfiguration().getProperty(ConfigurationConstants.KEY_USER_SECURITY_POLICY_CHECK))) {
userJnlpPolicy = getPolicyFromUrl(PathsAndFiles.JAVA_POLICY.getFullPath());
}

String jre = JavaSystemProperties.getJavaHome();
jreExtDir = (new File(jre + File.separator + "lib" + File.separator + "ext")).toURI();
Expand Down

0 comments on commit a96ed67

Please sign in to comment.