Forum Stats

  • 3,783,379 Users
  • 2,254,767 Discussions
  • 7,880,376 Comments

Discussions

Unable to override security properties via -Djava.security.properties

1000026
1000026 Member Posts: 4

Hello,

I am attempting override a property in the default .../jre/lib/security/java.security file by providing a file via the command line directive

-Djava.security.properties=/home/nb/security.properties


I'm using JDK 1.7_40, however this doesn't seem to work with JDK 1.6_32, 1.7_25 either.


The JVM continues using the default property provided in java.security.


My custom security.properties file contains just the one line:

jdk.certpath.disabledAlgorithms=MD2


I tried looking for a bug in this area, but all I found was this bug: <![CDATA[<a data-mce-href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7133344" class="" href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7133344" title="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7133344">Bug ID: JDK-7133344 Document the java.security.properties system property feature in the java.security file]]>

that confirms that I am supposed to override in the way I'm attempting.


The documentation doesn't specify whether the location of the overriding security file should be anything special, but I've tried an absolute path, as a well as a relative path thinking that perhaps it expects it in the current directory.


The way I test whether the property is set is:

Security.getProperty( "jdk.certpath.disabledAlgorithms" )


I've also checked that the following property is set to true (by default) in .../jre/lib/security/java.security:

security.overridePropertiesFile

Answers

This discussion has been closed.