immobiliare / ApnsPHP

ApnsPHP: Apple Push Notification & Feedback Provider
BSD 3-Clause "New" or "Revised" License
1.43k stars 454 forks source link

getting error when sending with http/2 #127

Closed EIBHomeControl closed 8 years ago

EIBHomeControl commented 8 years ago

ApnsPHP[5812]: INFO: Disconnected. Mon, 06 Jun 2016 12:03:53 +0200 ApnsPHP[5812]: INFO: Trying to initialize HTTP/2 backend... Notice: Use of undefined constant CURL_HTTP_VERSION_2_0 - assumed 'CURL_HTTP_VERSION_2_0' in /home/www/EIBServer/ApnsPHP/Abstract.php on line 412 Mon, 06 Jun 2016 12:03:53 +0200 ApnsPHP[5812]: INFO: Initialized HTTP/2 backend. Mon, 06 Jun 2016 12:03:53 +0200 ApnsPHP[5812]: INFO: Sending messages queue, run #2: 1 message(s) left in queue. Mon, 06 Jun 2016 12:03:53 +0200 ApnsPHP[5812]: INFO: Message ID 1 [custom identifier: unset] has no error (0), removing from queue... Mon, 06 Jun 2016 12:03:53 +0200 ApnsPHP[5812]: INFO: Disconnected.

duccio commented 8 years ago

Fixed in e8b163271286e3c08ce1f391a2763ba53a4579a0

EIBHomeControl commented 8 years ago

Just cherry picked you commit. But the problem still remains.

Evironment: new push certificate for adhoc and sandbox distribution push are sent with production param.

$push = new ApnsPHP_Push( ApnsPHP_Abstract::ENVIRONMENT_PRODUCTION, 'server_certificates_bundle_production.pem', ApnsPHP_Abstract::PROTOCOL_HTTP );

// Set the Root Certificate Autority to verify the Apple remote peer $push->setRootCertificationAuthority('entrust_root_certification_authority.pem');

duccio commented 8 years ago

What problem? Have you CURL with HTTP2 support built in your PHP version?

You have to generate a new certificate, you cannot use the same as binary version, please check: Creating a Universal Push Notification Client SSL Certificate

EIBHomeControl commented 8 years ago

CURL is not HTTP2 aware -> switched back to version 1.0.1.

Problem still remains. It has to do with the certificates. Renewal 2 days ago. Do i have to set a password for the certificate to work properly?