diff options
author | Xinchen Hui <laruence@php.net> | 2012-07-22 19:20:23 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2012-07-22 19:20:23 +0800 |
commit | a88eca53f708602384cae147a8376352d5909d90 (patch) | |
tree | 9756b70b4e0190dbea2626afe87875767b1f5050 /sapi/cli/php_cli_server.c | |
parent | fd50bf2085982e28b42a8665dd71009205eec108 (diff) | |
download | php-git-a88eca53f708602384cae147a8376352d5909d90.tar.gz |
Improve error message for ssl request
Diffstat (limited to 'sapi/cli/php_cli_server.c')
-rw-r--r-- | sapi/cli/php_cli_server.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 876c57a34d..02f885484f 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -1618,7 +1618,11 @@ static int php_cli_server_client_read_request(php_cli_server_client *client, cha client->parser.data = client; nbytes_consumed = php_http_parser_execute(&client->parser, &settings, buf, nbytes_read); if (nbytes_consumed != nbytes_read) { - *errstr = estrdup("Malformed HTTP request"); + if (buf[0] & 0x80 /* SSLv2 */ || buf[0] == 0x16 /* SSLv3/TLSv1 */) { + *errstr = estrdup("Unsupported SSL request"); + } else { + *errstr = estrdup("Malformed HTTP request"); + } return -1; } if (client->current_header_name) { |