Export to GitHub

shellinabox - issue #262

IE 11 - Can't connect with default compatibility mode.


Posted on Aug 22, 2014 by Happy Hippo
  • What steps will reproduce the problem?

Try to connect to shellinabox from IE 11, browser shows message: "This page can’t be displayed" with no other indication of what went wrong. Network transfer logs show a single page request with no data.

Enable IE 11 "compatibility mode" in the browser and it connects ok.

  • What is the expected output? What do you see instead?

Should be able to connect to shellinabox without setting compatibility mode.

  • What version of the product are you using? On what operating system?

Customized shellinabox based on 2.14 code, IE 11 on Windows 8.1.

  • Please provide any additional information below.

The problem appears to be with the ieBug detection code in libhttp/httpconnection.c. The code takes some actions based on finding "MSIE" in the user-agent string. IE 11 no longer has "MSIE" in the user-agent string, so the ieBug mitigation steps do not run. Putting IE 11 into "compatibility mode" changes the user-agent string back to one that contains "MSIE", so the ieBug code is triggered, and the connection works in that case.

It's probably not a good idea to have different code paths based on the content of the user-agent string. A better solution might be to figure out what the shellinabox httpd is doing that IE doesn't like, and fix that for all of the connections. Until then, here is a change that adds detection for the IE 11 user-agent string "rv:11" to enable ieBug mode.

In file libhttp/httpconnection.c:

@@ -569,7 +593,8 @@ int ieBug = 0; const char *userAgent = getFromHashMap(&http->header, "user-agent"); const char *msie = userAgent ? strstr(userAgent, "MSIE ") : NULL; - if (msie) { + const char *ie1 = userAgent ? strstr(userAgent, "rv:1") : NULL; + if (msie || ie1) { ieBug++; }

Comment #1

Posted on Dec 25, 2014 by Happy Horse

Instead of "rv:1", "Trident" or "Trident/7.0" may be better choices.

"In rare cases, it may be necessary to uniquely identify IE11. Use the Trident token to do so.", mentioned by Microsoft ( http://msdn.microsoft.com/en-us/library/ie/hh869301%28v=vs.85%29.aspx#ie11 )

Comment #2

Posted on Feb 27, 2015 by Massive Hippo

Instead of making the browser sniffing more complicated, would it not be better to drop it completely and use code that works for all current browsers?

The attached patch does this: * switch to gzip encoding (which is consistently implemented by everyone) instead of deflate; * drop all the browser sniffing code.

With this patch, shellinabox works in IE11 (tested), and should work in every version of IE since IE7 (not tested). It won't work any more in IE6 but even Microsoft has been telling everyone to please stop using IE6.

Attachments

Status: New

Labels:
Type-Defect Priority-Medium