Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue May 16, 2015 · 2 comments
Open

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

GoogleCodeExporter opened this issue May 16, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

* 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++;
   }



Original issue reported on code.google.com by [email protected] on 22 Aug 2014 at 7:40

@GoogleCodeExporter
Copy link
Author

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 )

Original comment by [email protected] on 25 Dec 2014 at 9:03

@GoogleCodeExporter
Copy link
Author

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.

Original comment by [email protected] on 27 Feb 2015 at 11:27

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant