keeping them in the build pack and pick them from there.
If at all possible, don't do this. It requires you to fork the buildpack and that is bad. It creates a maintenance burden for you and will slow down your ability to deploy updates and security patches to your apps running on Cloud Foundry.
But there are some certs which are part of cacert and needs to be picked from the JAVA_OPTS on PCF as environment variable like -Djavax.net.ssl.trustStore=
I'm not sure why you'd be forced to go this route. The -Djavax.net.ssl.trustStore
option is just setting the default trust store for the JVM. It can be convenient sometimes, but has it's drawbacks.
When you need to trust certs that are not signed by a well-known CA, I would suggest that you make your own application specific trust store, rather than to add more certs to the JVM's default trust store.
Your application will be more portable if it does not depend on system specific customizations like modifying the default trust store. Changing the default trust store is also problematic, because everything running in your JVM uses it. This is generally OK if you're just adding to the default trust store, but if you are trying to remove from it you might end up breaking other code. Plus, if you're using your own trust store you can include only the minimum number of certificates which are required by your app or even by a specific service in your app (since you can use multiple trust stores this way).
I don't know what HTTP client you're using, but there's a good example of doing this with HTTPClient here. See the Custom SSL context
example.
Putting that aside, if you really want to adjust the default trust store of the JVM running your app on Cloud Foundry, you just need to modify the JAVA_OPTS
environment variable for your app & restage.
Ex:
cf set-env my-cool-app JAVA_OPTS '-Djavax.net.ssl.trustStore=path/to/my/new/default-truststore.jks'
I believe you can use a relative path to your trust store, like if you're bundling it with your application. If not, /home/vcap/app
is the path to the root of your JAR/WAR file, so you could insert that if you need a full path. It needs to be a local path on the container though, I don't believe the JVM supports remote paths/URLs.
Jdk -> 1.7xx
You really need to upgrade :)