curl and http/2 for apns

Problems with the Windows version of XAMPP, questions, comments, and anything related.

curl and http/2 for apns

Postby sergiorch » 31. August 2016 14:09

Im trying to send message from php to ApplePushNotificationService with the new api which uses curl over http/2

For curl with htt2 to work, Ive downloaded ca-bundle.crt from:

Code: Select all
https://github.com/bagder/ca-bundle/blob/e9175fec5d0c4d42de24ed6d84a06d504d5e5a09/ca-bundle.crt

That cert works ok, but Now im facing the problem that it generates an error like this:

Code: Select all
?@@?HTTP/2 client preface string missing or corrupt. Hex dump for received bytes: 504f5354202f332f6465766963652f616538666562613534

I would like to know how can i enable curl to support http2. Only uncommenting "LoadModule http2_module modules/mod_http2.so" doesnt help

Thanks!
sergiorch
 
Posts: 2
Joined: 31. August 2016 14:00
XAMPP version: 5.6.23
Operating System: windows

Re: curl and http/2 for apns

Postby gsmith » 31. August 2016 20:20

The problem is that the curl in PHP 7.0.x does not support HTTP2.
Apache does (LoadModule) but that is only for Apache.

Looking at phpinfo() in PHP 7.0.10:
HTTP2: No
Protocols: dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp


There is however PHP builds by Jan-E. Jan's been doing this now for a few years and I trust his builds for whatever my opinion may be worth.

His phpinfo() for PHP 7.0.10 shows clearly HTTP2 is enabled.
https://phpdev.toolsforresearch.com/php-7.0.10-Win32-VC14-x86.htm
gsmith
 
Posts: 194
Joined: 29. November 2013 18:04
Location: San Diego
XAMPP version: 0.0.0
Operating System: Win XP to 2012R2/VS 6,9,11,14

Re: curl and http/2 for apns

Postby sergiorch » 02. September 2016 10:25

Thanks a lot gsmith!

This worked really good..i downloaded php build from Jan-E and installed it on httpd (https://httpd.apache.org/docs/current/platform/windows.html)

Now i can use ApplePushNotificationService
sergiorch
 
Posts: 2
Joined: 31. August 2016 14:00
XAMPP version: 5.6.23
Operating System: windows


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 63 guests