Safari-Push-Notifications icon indicating copy to clipboard operation
Safari-Push-Notifications copied to clipboard

No pushs, no registration and errors in logs

Open Djibs opened this issue 10 years ago • 14 comments

Hello,

Since today, I do not get the push on my website. Registration not work either.

I installed the patch to tls Friday and it worked fine until today.

My certificate has not expired but I see it in the logs :

[Mon Oct 27 14:26:10 2014] [error] [client xx.xxx.xx.xx] PHP Warning: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:14094415:SSL routines:SSL3_READ_BYTES:sslv3 alert certificate expired in /home/XXX/domains/XXX/private_html/kg/index.php on line 197 [Mon Oct 27 14:26:10 2014] [error] [client xx.xxx.xx.xx] PHP Warning: stream_socket_client(): Failed to enable crypto in /home/XXX/domains/XXX/private_html/kg/index.php on line 197 [Mon Oct 27 14:26:10 2014] [error] [client xx.xxx.xx.xx] PHP Warning: stream_socket_client(): unable to connect to tls://gateway.push.apple.com:2195 (Unknown error) in /home/XXX/domains/XXX/private_html/kg/index.php on line 197 [Mon Oct 27 14:26:10 2014] [error] [client xx.xxx.xx.xx] PHP Warning: fclose() expects parameter 1 to be resource, boolean given in /home/XXX/domains/XXX/private_html/kg/index.php on line 133 [Mon Oct 27 14:26:10 2014] [error] [client xx.xxx.xx.xx] PHP Warning: Missing argument 4 for connect_apns(), called in /home/XXX/domains/XXX/private_html/kg/index.php on line 134 and defined in /home/XXX/domains/XXX/private_html/kg/index.php on line 192 [Mon Oct 27 14:26:10 2014] [error] [client xx.xxx.xx.xx] PHP Warning: Missing argument 5 for connect_apns(), called in /home/XXX/domains/XXX/private_html/kg/index.php on line 134 and defined in /home/XXX/domains/XXX/private_html/kg/index.php on line 192 [Mon Oct 27 14:26:10 2014] [error] [client xx.xxx.xx.xx] PHP Notice: Undefined variable: passphrase in /home/XXX/domains/XXX/private_html/kg/index.php on line 195 [Mon Oct 27 14:26:10 2014] [error] [client xx.xxx.xx.xx] PHP Notice: Undefined variable: caFile in /home/XXX/domains/XXX/private_html/kg/index.php on line 196

For information, Debian no longer accepts SSLv3

Djibs avatar Oct 27 '14 15:10 Djibs

Can you double check when your certificate from apple expires? I know they only last for a year and I had to renew mine recently

On Monday, October 27, 2014, Djibs [email protected] wrote:

Hello,

Since today, I do not get the push on my website. Registration not work either.

I installed the patch to tls Friday and it worked fine until today.

My certificate has not expired but I see it in the logs :

[Mon Oct 27 14:26:10 2014] [error] [client xx.xxx.xx.xx] PHP Warning: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:14094415:SSL routines:SSL3_READ_BYTES:sslv3 alert certificate expired in /home/XXX/domains/XXX/private_html/kg/index.php on line 197 [Mon Oct 27 14:26:10 2014] [error] [client xx.xxx.xx.xx] PHP Warning: stream_socket_client(): Failed to enable crypto in /home/XXX/domains/XXX/private_html/kg/index.php on line 197 [Mon Oct 27 14:26:10 2014] [error] [client xx.xxx.xx.xx] PHP Warning: stream_socket_client(): unable to connect to tls:// gateway.push.apple.com:2195 (Unknown error) in /home/XXX/domains/XXX/private_html/kg/index.php on line 197 [Mon Oct 27 14:26:10 2014] [error] [client xx.xxx.xx.xx] PHP Warning: fclose() expects parameter 1 to be resource, boolean given in /home/XXX/domains/XXX/private_html/kg/index.php on line 133 [Mon Oct 27 14:26:10 2014] [error] [client xx.xxx.xx.xx] PHP Warning: Missing argument 4 for connect_apns(), called in /home/XXX/domains/XXX/private_html/kg/index.php on line 134 and defined in /home/XXX/domains/XXX/private_html/kg/index.php on line 192 [Mon Oct 27 14:26:10 2014] [error] [client xx.xxx.xx.xx] PHP Warning: Missing argument 5 for connect_apns(), called in /home/XXX/domains/XXX/private_html/kg/index.php on line 134 and defined in /home/XXX/domains/XXX/private_html/kg/index.php on line 192 [Mon Oct 27 14:26:10 2014] [error] [client xx.xxx.xx.xx] PHP Notice: Undefined variable: passphrase in /home/XXX/domains/XXX/private_html/kg/index.php on line 195 [Mon Oct 27 14:26:10 2014] [error] [client xx.xxx.xx.xx] PHP Notice: Undefined variable: caFile in /home/XXX/domains/XXX/private_html/kg/index.php on line 196

— Reply to this email directly or view it on GitHub https://github.com/surrealroad/Safari-Push-Notifications/issues/18.

Jack James http://about.me/jackjames, Surreal Road Limited http://www.surrealroad.com

www.surrealroad.com

surrealroad avatar Oct 27 '14 16:10 surrealroad

Can you check if a new visitor can request notifications from your site? It seems like this is no longer working, which is weird because that code (createPushPackage) hasn't been changed.

surrealroad avatar Oct 27 '14 21:10 surrealroad

I had indeed a problem with an expired certificate.

Now we can subscribe, but it’s impossible to send a push, it doesn’t work anymore.

Djibs avatar Oct 27 '14 21:10 Djibs

Doesn't look like it works for your site either. Apple must have revoked the .pem file or something.

surrealroad avatar Oct 27 '14 21:10 surrealroad

could be we need to change: define('CERTIFICATE_AUTHORITY', 'entrust_2048_ca.cer'); to define('CERTIFICATE_AUTHORITY', './entrust_2048_ca.cer'); I'm still unable to connect at all so can't provide any more info yet

surrealroad avatar Oct 27 '14 23:10 surrealroad

ok I've finally figured it out. So we got into a bit of a mess I think because your certificate had expired. So actually the only change that was ever required was to change ssl: to tls:

I've reverted all the unnecessary commits to index.php, give it a try.

surrealroad avatar Oct 28 '14 00:10 surrealroad

Hey @Djibs is your production certificate (.pem file) encrypted with a password?

surrealroad avatar Nov 03 '14 16:11 surrealroad

yes

Djibs avatar Nov 03 '14 17:11 Djibs

aha, we have a winner then I think. try implementing this in your service: https://github.com/surrealroad/Safari-Push-Notifications/blob/passworded-production-cert/index.php#L195

surrealroad avatar Nov 03 '14 17:11 surrealroad

it's not work. Notification sent (0 of 1 device(s) notified)

Djibs avatar Nov 03 '14 17:11 Djibs

Can you try with error logging on? See what the actual error is?

surrealroad avatar Nov 03 '14 18:11 surrealroad

how do I enable it?

Djibs avatar Nov 03 '14 20:11 Djibs

add something like:

error_reporting(E_ALL); ini_set('error_reporting', E_ALL); ini_set('display_errors',1); to the top of index.php on the push service

surrealroad avatar Nov 03 '14 20:11 surrealroad

Hey @Djibs I added some code to provide a little bit more of an error message if the APNS connection fails, it might help track down what your issue is.

Also I noticed that sometimes APNS says it has made the push, although no push is received. I unsubscribed my safari and resubscribed it, and the pushes started coming through.

surrealroad avatar Dec 02 '14 10:12 surrealroad