Cloud Foundry cf push command fails to download external buildpacks

The Cloud Foundry cf push -b https://<buildpack_path> commands fail.

Symptoms

The following error message is displayed during the deployment of an application that uses an external buildpack.

Staging...
 Failed to clone git repository at https://github.com/cloudfoundry-community/jboss-buildpack.git
 Exit status 1

Resolving the problem

Complete the following steps to identify the root cause of the problem:

  1. Deploy a simple application.
  2. Open a session in the container that holds the application: cf ssh <simple_app>.
  3. Navigate to the tmp directory: cd /tmp.
  4. Clone the buildpack into your tmp directory: git clone <buildpack>.
  5. Check for errors as shown in the following example:
    git clone https://github.com/cloudfoundry-community/jboss-buildpack.git
    Cloning into 'jboss-buildpack'...
    fatal: unable to access 'https://github.com/cloudfoundry-community/jboss-buildpack.git/': Problem with the SSL CA cert (path? access rights?)
    

SSL CA Cert issue

The certificates that are being used are probably self-signed. Complete the following steps to work around the problem:

  1. Download the buildpack to a location, such as the inception container, where the Cloud Foundry CLI is configured.
  2. Add the buildpacks. For information about adding buildpacks, see Add a buildpack Opens in a new tab. Be sure to choose the correct position for the buildpack when you place the buildpack in the list of currently available Cloud Foundry buildpacks. Note that Cloud Foundry makes buildpack selections based on the bundle application extension. For example, if you want to use jboss-buildpack and you deploy a .war file, you must verify that the jboss-buildpack is positioned before any other buildpacks which also manage .war files.

    cf create-buildpack <BUILDPACK_NAME> <DOWNLOADED_BUILDPACK_PATH> <POSITION>
    
  3. Use the following command to re-deploy the application:

    cf push -b <BUILDPACK_NAME>