Bug 46123 - Better error message when SSL connection arrives on non-SSL port
Summary: Better error message when SSL connection arrives on non-SSL port
Status: CLOSED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.5-HEAD
Hardware: All All
: P4 enhancement (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2008-10-29 12:20 UTC by Dan Poirier
Modified: 2009-02-10 05:19 UTC (History)
1 user (show)



Attachments
Patch to implement the improved error message (1.13 KB, patch)
2008-10-29 12:21 UTC, Dan Poirier
Details | Diff
Patch to implement the improved error message (1.05 KB, patch)
2008-10-30 07:33 UTC, Dan Poirier
Details | Diff
Patch to implement the improved error message (1.27 KB, patch)
2009-01-29 09:00 UTC, Dan Poirier
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Poirier 2008-10-29 12:20:45 UTC
This patch provides a better error message when an SSL connection arrives on a non-SSL port.

Right now the error log message looks like:

[Wed Oct 29 11:24:28 2008] [error] [client 127.0.0.1] Invalid method in request \x16\x03\x01

The patch notices that those first few bytes look like an SSL client handshake, and changes the message to:

[Wed Oct 29 11:55:14 2008] [error] [client 127.0.0.1] Invalid method in request \x16\x03\x01 - possible attempt to establish SSL connection when the server isn't expecting it

which should make the cause a little clearer and easier to fix.


Thanks to Eric Covener for suggesting this.
Comment 1 Dan Poirier 2008-10-29 12:21:33 UTC
Created attachment 22791 [details]
Patch to implement the improved error message
Comment 2 Dan Poirier 2008-10-30 07:33:16 UTC
Created attachment 22796 [details]
Patch to implement the improved error message

Tweak the patch slightly: 
- Be safe, check r->the_request before dereferencing.
- Drop comments to unclutter things, the error message should make clear what the code is looking for
Comment 3 Dan Poirier 2009-01-29 09:00:00 UTC
Created attachment 23195 [details]
Patch to implement the improved error message

Tweak the comment to explain what's being done, and
clarify that it's safe here to peek at the first few
bytes of r->the_request.

Any additional feedback on this patch is welcome.
Comment 4 Dan Poirier 2009-02-10 05:19:37 UTC
Committed to trunk by covener
http://svn.apache.org/viewvc?rev=739620&view=rev