wultra / powerauth-push-server

PowerAuth Push Server repository
Apache License 2.0
25 stars 12 forks source link

Embedded Tomcat Unable to load certificates #801

Closed banterCZ closed 7 months ago

banterCZ commented 7 months ago

When running java -jar powerauth-push-server.war, unable to load certificates.

2024-03-01T15:53:33.830+01:00 ERROR 24458 --- [           main] [                                                 ] io.getlime.push.util.CaCertUtil          : Certificate error: class path resource [cacert/USERTrustRSAAAACA.pem] cannot be resolved to absolute file path because it does not reside in the file system: jar:nested:/Users/lubosracansky/IdeaProjects/powerauth-push-server/powerauth-push-server/target/powerauth-push-server-1.7.0-SNAPSHOT.war/!WEB-INF/classes/!/cacert/USERTrustRSAAAACA.pem

java.io.FileNotFoundException: class path resource [cacert/USERTrustRSAAAACA.pem] cannot be resolved to absolute file path because it does not reside in the file system: jar:nested:/Users/lubosracansky/IdeaProjects/powerauth-push-server/powerauth-push-server/target/powerauth-push-server-1.7.0-SNAPSHOT.war/!WEB-INF/classes/!/cacert/USERTrustRSAAAACA.pem

https://github.com/wultra/powerauth-push-server/blob/develop/powerauth-push-server/src/main/java/io/getlime/push/util/CaCertUtil.java#L104

banterCZ commented 7 months ago

See https://stackoverflow.com/a/68913967/204950

OliverJanstaWultra commented 7 months ago

@banterCZ will prepare hints on how to test it and @korbelm will test it.

banterCZ commented 7 months ago

In the log, we should see only

logger.info("Importing embedded certificate: {}", certPath);

not any

logger.error("Certificate error: {}", e.getMessage(), e);

The code in CaCertUtil is invoked when sending a push message via APNS.

korbelm commented 7 months ago

certificates are successfully loaded on embedded/full tomcat