0
votes

I have implement the push notification after create the ck.pem file on development end. But when i create on distribution end then we check the ck.pem file is correct or not.I have error show below:-

pksinghs-Mac-mini:SchoolPush pksingh$ php /Users/pksingh/Desktop/SchoolPush/simplepush.php

Warning: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:14094416:SSL routines:SSL3_READ_BYTES:sslv3 alert certificate unknown in /Users/pksingh/Desktop/SchoolPush/simplepush.php on line 21

Warning: stream_socket_client(): Failed to enable crypto in /Users/pksingh/Desktop/SchoolPush/simplepush.php on line 21

Warning: stream_socket_client(): unable to connect to ssl://gateway.push.apple.com:2195 (Unknown error) in /Users/pksingh/Desktop/SchoolPush/simplepush.php on line 21 Failed to connect: 0 pksinghs-Mac-mini:SchoolPush pksingh$

i have ck.pem file and pushnofication.php in same folder on desktop. Can anybody help me.

1

1 Answers

0
votes

Find the tutorial for how to create certificate and implement notification from below link

https://www.raywenderlich.com/123862/push-notifications-tutorial

you can use below command to create certificate

so there are something wrong in creating distribution certificate

Use below command to create certificate

openssl x509 -in aps_production.cer -inform der -out PushChatCert.pem

openssl pkcs12 -nocerts -out PushChatKey.pem -in Certificates_dist.p12

cat PushChatCert.pem PushChatKey.pem > ck_dist.pem

openssl s_client -connect gateway.push.apple.com:2195 -cert PushChatCert.pem -key PushChatKey.pem

where

aps_production.cer = downloaded from developer apple

Certificates_dist.p12 = Exported from your keychain after installing aps_production.cer