0

I'm using Google Cloud Endpoints as back end of a mobile application. Now i want to implement push notifications for the iOS client but can't load the .p12 certificate from an @ApiMethod, get this error message:

Invalid keystore reference. File does not exist: /base/data/home/apps/s~my-ws/1.379168523188882449/MyCert.p12"

I added the certificate under /src directory but does not seem to recognize it.

I'm using IntelliJ IDEA, Appengine API 1.9.12, javapns (for Push Notifications) and Maven.

Edit

Maybe i made a step forward.

I put the .p12 file under /src/webapp/WEB-INF/ and added

<configuration>...<webResources><resource><includes><include>*.p12</include>

in my pom.xml.

Then i run mvn clean install && mvn appengine:endpoints_get_discovery_doc and inspected the generated myws-1.0-SNAPSHOT.war. Within the .war file there is my MyCert.p12certificate, but i get this error message now:

java.security.AccessControlException: access denied (\"java.io.FilePermission\" \"/WEB-INF/MyCert.p12\" \"read\")"
Mattia Campana
  • 509
  • 2
  • 6
  • 15

1 Answers1

0

Could you check the code that is actually loading the cert? It may be that you need to remove a leading slash from the File constructor. This is not an App Engine thing but a java File thing.

Also, unrelated to your solution but helpful, is a thread here on best ways to store p12 files on App Engine.

Community
  • 1
  • 1
Nick
  • 3,581
  • 1
  • 14
  • 36