|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79575 Content-Length header name is getting corrupted
Submitted: 2020-05-08 16:59 UTC Modified: 2020-05-11 08:56 UTC
Avg. Score:4.3 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:2 (100.0%)
From: kevin dot seymour at gmail dot com Assigned:
Status: Verified Package: OpenSSL related
PHP Version: 7.3 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: kevin dot seymour at gmail dot com
New email:
PHP Version: OS:


 [2020-05-08 16:59 UTC] kevin dot seymour at gmail dot com
When you run the below script you'll see the Content-Length header will come back with the correct value, but that the word Content is jumbled.  For example:

Cteonnt-Length: 195628.

If you change Accept-Encoding to identity (disable compression) the value comes back correctly.  This is causing unexpected end of data errors when we use SoapClient to attempt to parse a WSDL as only part of the XML is returned.

There is a lot of testing information here:

Test script:
php << 'EOF'
$ctx = stream_context_create(array(
    'http' => array(
        'header' => "Accept-Encoding: gzip"
$xml = file_get_contents('', false, $ctx);
echo var_dump($http_response_header);

Expected result:
Content-Length should remain with the same header name.

Actual result:
Content-Length header field name is corrupted.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-05-09 13:32 UTC]
-Status: Open +Status: Verified -Package: *Compression related +Package: OpenSSL related -Operating System: RHEL +Operating System: * -PHP Version: 7.2.30 +PHP Version: 7.3
 [2020-05-09 13:32 UTC]
Apparently, the respective SSL_read() call[1] yields the broken

[1] <>
 [2020-05-11 08:00 UTC]
This is pretty weird. If the corrupted output comes from SSL_read(), then I don't think the problem here can be on the PHP side, right?
 [2020-05-11 08:56 UTC]
I'm not sure whether we prepare SSL correctly for this case.
 [2020-07-15 02:58 UTC] kevin dot seymour at gmail dot com
Is there additional information required to diagnose this issue completely? Was it determined if this was indeed an OpenSSL issue?
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Feb 26 07:01:28 2024 UTC