Pivotal Knowledge Base

Follow

How to Specify Network Address.* Security Properties when Pushing Java Applications

Environment

Java Buildpack all versions

Purpose

This document describes how to specify Java Security Properties when pushing Java applications.

Cause 

If you are developing for non-PCF Java applications, setting security properties can be done by following either one of these methods:

1. Editing $JAVA_HOME/jre/lib/security/java.security and adding the following lines:

  • networkaddress.cache.ttl=60
  • networkaddress.cache.negative.ttl=20

2. Or, using application’s initialization code, sample below:

  • java.security.Security.setProperty("networkaddress.cache.ttl" , "60");

Procedure

Here are the steps on how to add Java Security Properties when pushing Java applications:

1. Edit your application manifest file

2. Locate env and add the security properties in your JAVA_OPTS. Please note that you need to append java.security prefix 

env:

JAVA_OPTS: -Djava.security.networkaddress.cache.ttl=60 -Djava.security.networkaddress.cache.negative.ttl=20

Additional Information

Java Networking Properties 

How to set java environment variables in PCF and PWS.

 

Comments

Powered by Zendesk