Policy plugin and private certificate : error java.lang.NullPointerException
search cancel

Policy plugin and private certificate : error java.lang.NullPointerException

book

Article ID: 220032

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

Unable to create Policy plugin bundle with a P12 private key.

The private key and the password are correct and  can be imported on the gateway with the policy manager.

gradlew clean build-full-bundle

when I create the bundle I have this error :

> Task :build-full-bundle FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':build-full-bundle'.
> java.lang.NullPointerException (no error message)

 

Environment

Release : 10.0

Component : API GATEWAY

Cause

The certificate name in the p12 files does not match the name used in the build.gradle which is causing a java.lang.NullPointerException.

Resolution

To be able to create the bundle, the certificate name in the p12 file needs to match the name used in the config build.gradle file.

See the example snippet from the build.gradle  below having  a p12 file called certificate.p12 which contains a certificate called "mycert" and the password is "notasecret" :

  "PRIVATE_KEY_FILE.mycert.p12":file("./main/gateway/config/privateKeys/certfile.p12"),
  "PRIVATE_KEY.mycert":file("./main/gateway/config/privateKeys/certfile.yml")

update the  certificate.yml with

mycert:
  keystore: "Software DB"
  algorithm: "RSA"
  keyPassword: "notasecret"

see also:

https://techdocs.broadcom.com/us/en/ca-enterprise-software/layer7-api-management/gateway-policy-plugin/1-0/environment-configuration/migrate-private-keys.html