Hi!
I’m testing the Push Notification of Expo from my backend down to the mobile, but I can’t manage to send the notifications. I’m getting this exception in the backend upon sending the POST to the Expo server:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Apparently, it has something to do with certificate??
Is it because I’m starting my server in localhost so my call to it (to send the notifications) is in http
and it must be in https
?
I’m using the HTTP way to send notification (My backend is in Java) https://docs.expo.io/versions/latest/guides/push-notifications.html#http2-api
Here’s my api call:
private Response sendRequest(List<String> messages) {
Client client = ClientBuilder.newClient();
return client.target("https://exp.host/--/api/v2/push/send")
.request()
.header("accept", "application/json")
.header("accept-encoding", "gzip, deflate")
.header("content-type", "application/json")
.post(Entity.json(messages));
}