views:

1927

answers:

2

I have been getting this error messages from my PHP code used to send message to the APNS...has anyone got faced the same issue?

Warning: stream_socket_client() [function.stream-socket-client]: SSL operation 
failed with code 1. OpenSSL Error messages: error:14094410:SSL routines:
SSL3_READ_BYTES:sslv3 alert handshake failure in 
/Library/WebServer/Documents/anish/apns/2.php on line 8

Warning: stream_socket_client() [function.stream-socket-client]: Failed to enable 
crypto in /Library/WebServer/Documents/anish/apns/2.php on line 8

Warning: stream_socket_client() [function.stream-socket-client]: unable to connect 
to ssl://gateway.sandbox.push.apple.com:2195 (Unknown error) in /Library/WebServer
/Documents/anish/apns/2.php on line 8
Failed to connect: 0

Warning: fclose(): supplied argument is not a valid stream resource in   
/Library/WebServer/Documents/anish/apns/2.php on line 20*

Also it seems it always fails to connect to gateway.sandbox.push.apple.com. I even tried with PushMeBaby and it too fails to connect to gateway.sandbox.push.apple.com

+1  A: 

the problem apparently was with the installation of certificates. If the certificate are installed properly, then everything works great like a charm..! -Anish http://www.macoscoders.com/

Anish
A: 

@Anish - Can you provide any more details on how to get the certificates installed properly? I've exported the Certificate & Private Key together and converted them into .pem files, but I still receive this error. Any ideas?

elioty
@elioty, I was getting "unable to connect" becoz i had uploaded the CertificateSigningRequest.certSigningRequest to Program Portal from my development machine and later installed the developer_identity.cer from Program Portal to a different machine which was hosting the provider server. If you use the same machine which is finally going to run your server and do all the .pem file generation on the same machine, then this error will be fixed.I have outlined the steps on my blog http://www.macoscoders.com/2009/05/17/iphone-apple-push-notification-service-apns/-Anish
Anish