0

I successfully sent push notification from apache web server with PHP script. Then I have transferred the complete code and html to IIS. After trying to send the push notification, I get following warning:

Warning (2): stream_socket_client() [http://php.net/function.stream-socket-client]: SSL operation failed with code 1. OpenSSL Error messages:
error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure [APP\controllers\push_notifications_controller.php, line 79]Code | Context$text   =   "test from hugh"
$apnsHost   =   "gateway.sandbox.push.apple.com"
$apnsPort   =   2195
$apnsCert   =   "../vendors/certificate.pem"
$streamContext  =   resource
$error  =   0
$errorString    =   ""stream_socket_client - [internal], line ??
PushNotificationsController::__send_push_notification() - APP\controllers\push_notifications_controller.php, line 79
PushNotificationsController::index() - APP\controllers\push_notifications_controller.php, line 58
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
require - APP\webroot\index.php, line 83
[main] - CORE\index.php, line 55

I think that something is wrong with the certificate.pem file, or the way IIS is handling ssl. Could you please help?

Kara
  • 6,115
  • 16
  • 50
  • 57
Mladen
  • 25,578
  • 11
  • 39
  • 48

1 Answers1

0

You first need to ensure that the ports (2195 and 2196) on the firewall are open.

Also: Error Using PHP for iPhone APNS <-- said it was a problem with the certificate..

Community
  • 1
  • 1
ChrisH
  • 1,283
  • 1
  • 9
  • 22