4

I'm using php script for pushing notification on my application. But on following line

$fp = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT, $ctx);"

where

$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'local_cert', 'ck.pem');

I get an error as follows:

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/amit/Desktop/NotificationFolder/apns.php on line 29

Warning: stream_socket_client(): Failed to enable crypto in /Users/amit/Desktop/NotificationFolder/apns.php on line 29

Warning: stream_socket_client(): unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Unknown error) in /Users/amit/Desktop/NotificationFolder/apns.php on line 29
Failed to connect 0

Do any one know how to get rid of this problem?? Beside it everything works fine.

eloibm
  • 899
  • 2
  • 11
  • 27
vicky1456
  • 41
  • 1
  • 2
  • Also see [“verify error:num=20” when connecting to gateway.sandbox.push.apple.com](http://stackoverflow.com/a/23351633/608639). You should ensure three things: (1) TLS 1.0 or above; (2) Server Nam Indication; (3) *Entrust.net Certification Authority (2048)* root. – jww Nov 14 '16 at 06:43

1 Answers1

0

what's your certificate password, is it given correctly and is you certificate really found in ck.pem ? How did you create your certificate?

Blitz
  • 5,521
  • 3
  • 35
  • 53
  • Yup! I've given password correctly and my certificate is found in my ck.pem. Thanks for your hand of help, but seeking more help from you. Do reply – vicky1456 Dec 29 '10 at 05:53