MegatronKing/NetBare-Android

NetBare sample app not working with azure.microsoft.com (ERR_EMPTY_RESPONSE)

lmoretto opened this issue · 4 comments

The NetBare sample app doesn't properly work when trying to visit azure.microsoft.com page.

When I try to navigate to that page, using for instance Chrome, I get the following error ERR_EMPTY_RESPONSE:

image

The weird thing is that, with HttpCanary, the page works as expected:

image

After further investigation, this seems to be somehow related to to the MTU.

If i change NetBare's default MTU config from 4096 to 8192, then everything works as expected.

However, it's not clear to me what the real cause of the bug is.

Any ideas/suggestions?

@lmoretto Have you found any solution to this problem?

With 4096 MTU, The connection is being reset and hence there is no response being received.

WIth 8192 MTU however, The site works, but Microsoft OneDrive download site fails to load.(It actually works on Android 10, but not on Android 8.1). Weird behavior.

@MegatronKing Please guide us :)

I also just noticed this:

The requests being sent to Azure/OneDrive(Assuming both of them using same server architecture) are sometimes being sent using "HTTP/1.1" protocol and this is when the website doesn't load.

When the requests are using "h2" protocol, the website loads fine.

What i have noticed in HttpCanary app is that, only h2 protocol (for Azure/OneDrive websites) is being used unlike the mysterious switching between h2 and HTTP/1.1 protocol's in netbare-sample app.

This problem is same as #28 .

As quoted by @MegatronKing :

In addition, the open source Netbare version of ALPN negotiation logic is flawed in design (the h2 protocol cannot be located under certain special requests), and the closed source version used internally by HttpCanary has no problems.

IDK why megatronking decided not to make changes to open source version. But, i wish he does so in the future :(