0
votes

I have Java microservice running in a PCF environment. The app calls third party NIST api and getting a SSL certification validation issue. Hence I want to add the NIST certificate to cacerts of the buildpack created by PCF

  • I created .profile file and extracted NIST certificate as nist.gov.cert
  • Crated jar from Springboot application
  • Extracted the jar and pack .profile & nist.gov.cert and recreate .jar
  • cf push the application

Content of .profile

    echo "Installing custom certificates..."

    $HOME/.java-buildpack/open_jdk_jre/bin/keytool -keystore $HOME/.java-buildpack/open_jdk_jre/lib/security/cacerts -storepass changeit -importcert -noprompt -alias nist -file $HOME/nist.gov.cert

    echo "Done installing custom certificates..."

From the logs of PCF I see the script in .profile is getting executed. But complains nist.gov.cert does not exist.

enter image description here

But when I ssh into the container I can find the certificate file exist.

enter image description here

What could be the reason and how to resolve this?