I'm trying to connect via curl with an existing certificate through APNS http2 API.
$/usr/local/Cellar/curl/7.47.1/bin/curl -v -d \
'{"aps":{"alert":"hi","sound":"default"}}' \
--cacert cert.pem --key key.pem --cert clientcert.pem \
-H "apns-topic: topics" --http2 \
https://api.development.push.apple.com/3/device/<device_token>
Ive generated the cert, key and cacert from openssl command following this link : http://www.rajatswarup.com/blog/2007/03/10/using-certificates-with-curl/
With this command, I get this error:
{"reason":"MissingProviderToken"}
I get the same error when I try with POSTMAN also. How do I resolve this?
Second try with this curl command:
/usr/local/Cellar/curl/7.47.1/bin/curl -v -d \
'{"aps":{"alert":"hi","sound":"default"}}' \
--cert clientcert.pem:<passphrase> \
--key key.pem \
-H "apns-topic: topics" --http2 \
https://api.development.push.apple.com/3/device/<devide_token>
Here I get the below error :
error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown
* Closing connection 0
curl: (35) error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown
I've also tried with Jetty client using Java following this link : https://judepereira.com/blog/sending-notifications-via-apples-new-http2-api-using-jetty-9-3-6/ but this also does not work and it hangs whole POST request and does not return any response. My certificate is a valid development certificate, so what is the main issue here? Can someone please help me out?
Thanks :)