HTTP 错误代码 505 [英] HTTP error code 505
问题描述
我已经在谷歌上搜索到 505 是不支持 HTTP 版本",但仍然无法弄清楚我的问题.我有一个带有 Tomcat 的 Web 应用程序,服务器端带有自签名证书以启用 HTTPS,无需对客户端进行身份验证.客户端将验证服务器证书.我已经分析了wireshark数据包,看来SSL handshark是正确的.但是当我检查Tomcat localhost_access_log时,客户端请求会出现505错误,服务器端也没有收到客户端请求.你能帮忙提供一些提示吗?
I have already googled that 505 is "HTTP Version not supported", but still can not figure out my problem. I have a web application with Tomcat,server side with self-signed certificate to enable HTTPS,without authenticating client. The client will authenticate server certificate. I have analyze the wireshark packet, it seems the SSL handshark is correct. But when i check Tomcat localhost_access_log,there will be an 505 error for the client request, also server side does not receive the client request. Could you kindly help to give some hint on this?
172.25.21.113 - - [24/May/2012:16:28:26 +0800] "GET /updserver/update?action=signature_update&device_type=NGN&service_type=KAV&engine_ver=1.00&sig_ver=4.123&mac=0019CB72736E HTTP/1.1 " 505 -
推荐答案
如果您在 HTTP 版本之后使用尾随空格向 Tomcat 发出请求(如您的示例中所示),Tomcat 将响应 505 错误.已在 Tomcat 7.0.27 上确认.
If you make a request to Tomcat with trailing whitespace after the HTTP version (as in your example), Tomcat will respond with 505 error. Confirmed on Tomcat 7.0.27.
RFC 2616 (HTTP 1.1) 规定 HTTP-Version
由 "HTTP/" + digit + "." 组成.+ 数字
.请求行以 " " + HTTP-Version + CRLF
结尾,这意味着在最后一位数字之后不允许有空格.
RFC 2616 (HTTP 1.1) says that the HTTP-Version
is made up of "HTTP/" + digit + "." + digit
. Request-Line ends with " " + HTTP-Version + CRLF
which means no whitespace is allowed after that last digit.
参考文献:
- HTTP 版本:http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.1
- 请求行:http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1
这篇关于HTTP 错误代码 505的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!