Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP error code 505

Tags:

ssl

tomcat

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 -
like image 834
Simon Wang Avatar asked May 24 '12 08:05

Simon Wang


People also ask

How do I fix error 505?

In such cases, your browser is trying to connect to a modern web server using old HTTP versions. So, the best way to fix this is to switch to a modern browser like Firefox or Google Chrome. If you are using a modern browser and have faced error 505, then the quickest solution is to clear your browser's cache.

How do I fix HTTP version not supported?

If you see this error in your Web browser, try a newer version or switch to a modern browser to see if the error goes away. Further, if you still see this error in your Web browser, upgrade your orgin Web server software to support the major version of the http protocol you require.

What does unsuccessful HTTP response mean?

Status codes in the 400s and 500s indicate that there's an error with the requested resource. If a search engine encounters a status code error when it's crawling a web page, it may not index that page properly.

What is the HTTP server error code?

Successful responses ( 200 – 299 ) Redirection messages ( 300 – 399 ) Client error responses ( 400 – 499 ) Server error responses ( 500 – 599 )


2 Answers

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) 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.

References:

  • HTTP-Version: http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.1
  • Request-Line: http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1
like image 149
Christopher Schultz Avatar answered Oct 13 '22 20:10

Christopher Schultz


Clearly not the answer for the OP, but I ran into this error message tonight while trying to debug a SOLR server.

My problem wasn't an extra space after the HTTP version.

my client application was logging the bad URL, which i blithely copied & pasted into a telnet connection to the SOLR tomcat's http port. My log message showed the URL without properly %20-encoding a space in the URL. I got the bad HTTP version error, presumably because it was interpreting everything after the space in the URL as my HTTP version.

thanks to http://java.dzone.com/news/solr-tomcat-and-http11-505 for the hint.

like image 22
Dan Pritts Avatar answered Oct 13 '22 19:10

Dan Pritts