I have done some research on this subject and found the following.  The error
only occurs for me when making HTTPS request.  If I make an HTTP request I
never experience this issue.  Additionally I've found that setting a
content-type header alleviates the problem.  Specifically setting the
charset from iso-8859-1 to utf-8 removes the issue.  

This bug is extremely hard to reproduce as it seems that apache needs to run
a while, perhaps days, before the bug presents itself.

Following is my test script using PHP and Curl. Please note the Content-Type
header commented out.  In my case setting the charset to iso-8859-1 causes
the bug to present itself.  On the other hand setting it to utf-8
mysteriously fixes the issue.

Could it be an encoding issue? 

Mike, in regards to your comments about mod_rewrite and mod_deflate.  I do
have a mod_rewrite rule that forces port 80 traffic to port 443 so this
could just as well be part of the issue.  Perhaps mod_rewrite is having a
parsing error when parsing non utf-8 charsets?  I do have mod_deflate
installed but I'm not sure how that it behaves differently for HTTP versus
HTTPS and because I'm unable to reproduce the issue on HTTP request I'm
assuming that the issue must either be mod_rewrite or mod_ssl.  You
mentioned in your post that you've yet to see the issue and you're running
mod_ssl, so that increases my suspicion about mod_rewrite.

Test script follows:

    while ($i <= 1000)
    {
      echo $i."\n";
      $ch = curl_init('https://www.url.com');
      curl_setopt($ch, CURLOPT_HEADER, true); 
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
      //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/html;
charset=utf-8'));
      $output = curl_exec($ch);
      
      $info = curl_getinfo($ch);
      if($info['http_code'] == 400)
      {
        echo $output;
        exit();
      }
      curl_close($ch);
      $i++;
      
      sleep(1);
    }

Lance

michael cole-4 wrote:
> 
> Hi,
> 
> I disabled mod_rewrite and mod_deflate and haven't seen the problem since.
> I have mod_ssl enabled and use https for the application.
> 
> That's the same error I was getting in my logs.  I have to do some more
> testing, but if you want a lead, those two modules are it.
> 
> Mike
> 
> 
> On Fri, Sep 3, 2010 at 9:51 AM, figfig <phi...@employeehub.com> wrote:
> 
>>
>> Hi guys,
>>
>> I've been having the exact same problem. I'm also using Apache 2, Ubuntu
>> 10.04 and a GoDaddy SSL certificate. Every now and then I get a Bad
>> Request.
>> The error log shows
>>
>> "Hostname mysite.com provided via SNI, but no hostname provided in HTTP
>> request"
>>
>> If I restart Apache it doesn't occur for a while but always comes back.
>> I've
>> noticed it in Firefox.
>>
>> Has anyone worked out what the problem is?
>>
>> --
>> View this message in context:
>> http://old.nabble.com/-users%40httpd--Intermittent-%22Request-header-field-is-missing-%27%3A%27-separator.%22-on-https-tp29577884p29616242.html
>> Sent from the Apache HTTP Server - Users mailing list archive at
>> Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server
>> Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
>>   "   from the digest: users-digest-unsubscr...@httpd.apache.org
>> For additional commands, e-mail: users-h...@httpd.apache.org
>>
>>
> 
> 

-- 
View this message in context: 
http://old.nabble.com/-users%40httpd--Intermittent-%22Request-header-field-is-missing-%27%3A%27-separator.%22-on-https-tp29577884p29639141.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
   "   from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to