#46775 [Opn->Bgs]: file_get_contents via HTTPS wrapper produces corrupt response from eBay API
| From: | bjori@php.net | Date: | Fri, 12 Dec 2008 09:27:58 +0000 |
| Subject: | #46775 [Opn->Bgs]: file_get_contents via HTTPS wrapper produces corrupt response from eBay API | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-131939@lists.php.net to get a copy of this message | ||
ID: 46775
Updated by: bjori@php.net
Reported By: php1 at nmpu dot com
-Status: Open
+Status: Bogus
Bug Type: OpenSSL related
Operating System: *
PHP Version: 5.2CVS-2008-12-06 (snap)
New Comment:
You are getting HTTP/1.1 chunked content back.
The PHP streams do not support it.
This actually seems like a bug in the eBay servers to me as (unless you
explicitly set it) we send out HTTP/1.0 requests.
Make sure you dont have a default context setting the protocol_version
option, or report it to eBay :)
(for more info about the context options see: http://php.net/context)
Previous Comments:
------------------------------------------------------------------------
[2008-12-06 04:37:52] php1 at nmpu dot com
Description:
------------
I use file_get_contents with the HTTPS wrapper to post a request to an
eBay API server and retrieve the response. Recently, I noticed a
response with what appears to be leading and trailing garbage. A similar
solution based on cURL produces the expected response (no garbage). The
issue was originally discovered on a Linux/Apache box. I downloaded the
latest WIN32 PHP/Apache and can still reproduce.
Reproduce code:
---------------
http://exdwh.com/ebay/bugs/https_wrapper_bug.txt
Contact me if you don't have easy access to the necessary eBay
authorization tokens. You could sign up at http://developer.ebay.com
quicker than sending me an e-mail and waiting for the response. :)
Expected result:
----------------
cURL says |<?xml version='1.0' encoding='UTF-8'?><getJobsResponse
xmlns:sct="http://www.ebay.com/soaframework/common/types"
xmlns="http://www.ebay.com/marketplace/services"><ack>Success</ack><version>1.0.0</version><timestamp>2008-12-06T03:26:32.487Z</timestamp></getJobsResponse>|
Actual result:
--------------
http wrapper says |10d <?xml version='1.0'
encoding='UTF-8'?><getJobsResponse
xmlns:sct="http://www.ebay.com/soaframework/common/types"
xmlns="http://www.ebay.com/marketplace/services"><ack>Success</ack><version>1.0.0</version><timestamp>2008-12-06T03:26:32.278Z</timestamp></getJobsResponse>
0 |
Leading garbage is: 31 30 64 0D 0A
Trailing garbage is: 0D 0A 30 0D 0A 0D 0A
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46775&edit=1