Bug 57935 - Networking not working on VPN
Summary: Networking not working on VPN
Status: CONFIRMED
Alias: None
Product: iOS
Classification: Xamarin
Component: BCL Class Libraries (show other bugs)
Version: XI 10.3 (iOS 10.2)
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-07-05 09:09 UTC by Lukas Lipka
Modified: 2017-07-11 12:31 UTC (History)
6 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Build log (327.17 KB, text/plain)
2017-07-10 16:09 UTC, Lukas Lipka
Details
Test case (try with and without having the My Data Manager app installed) (13.08 KB, application/zip)
2017-07-10 16:10 UTC, Lukas Lipka
Details

Description Lukas Lipka 2017-07-05 09:09:49 UTC
Customers have reported that our app stops functioning once they install the following app:

My Data Manager (https://itunes.apple.com/us/app/my-data-manager-track-data-usage-and-save-money/id477865384?mt=8)

That app seems to be doing some weird stuff with regards to VPN/proxying by installing a VPN configuration into iOS to track data usage. This seems to trip up the entire Xamarin/Mono networking stack - connections via NSURLSession (that Apple framework still work) but web requests via the Xamarin network stack fail with the following exception:

```
2017-06-07 15:39:28.018 TinkFrontendMobileApple[348:23824] System.Net.WebException: Error getting response stream (ReadHeaders): ServerProtocolViolation ---> System.Exception:   at System.Net.WebConnection.HandleError (System.Net.WebExceptionStatus st, System.Exception e, System.String where) [0x00031] in <dfac2ad8ae7c42209218a908c3070036>:0 
  at System.Net.WebConnection.ReadHeaders (System.IO.Stream stream, System.Byte[]& retBuffer, System.Int32& status) [0x0002c] in <dfac2ad8ae7c42209218a908c3070036>:0 
  at System.Net.WebConnection.CreateTunnel (System.Net.HttpWebRequest request, System.Uri connectUri, System.IO.Stream stream, System.Byte[]& buffer) [0x0024b] in <dfac2ad8ae7c42209218a908c3070036>:0 
  at System.Net.WebConnection.CreateStream (System.Net.HttpWebRequest request) [0x0004b] in <dfac2ad8ae7c42209218a908c3070036>:0 
  at System.Net.WebConnection.InitConnection (System.Object state) [0x00078] in <dfac2ad8ae7c42209218a908c3070036>:0 
  at System.Net.WebConnection.<.ctor>b__30_0 (System.Object state) [0x00000] in <dfac2ad8ae7c42209218a908c3070036>:0 
  at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) [0x0000d] in <2f4074c3120b4d80802e10af84b67d41>:0 
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <2f4074c3120b4d80802e10af84b67d41>:0 
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <2f4074c3120b4d80802e10af84b67d41>:0 
  at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00021] in <2f4074c3120b4d80802e10af84b67d41>:0 
  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00074] in <2f4074c3120b4d80802e10af84b67d41>:0 
  at ObjCRuntime.Runtime.ThreadPoolDispatcher (System.Func`1[TResult] callback) [0x00006] in <7593f0e3372945ac803cd9573d505380>:0 
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00009] in <2f4074c3120b4d80802e10af84b67d41>:0 
  at System.Net.WebConnection.HandleError (System.Net.WebExceptionStatus st, System.Exception e, System.String where) [0x00031] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.10.0.36/src/mono/mcs/class/System/System.Net/WebConnection.cs:446 

  Status: ServerProtocolViolation
```
Comment 1 Timothy Risi 2017-07-05 22:27:42 UTC
Please include your full build logs, crash reports (if any), test case (to reproduce) and all version information.

To get full build logs just set the log verbosity to diagnostic at the following locations:
- On Visual Studio for Mac: Preferences > Projects > Build
- On Visual Studio for Windows: Tools > Options > Projects and Solutions > Build and Run

On Visual Studio Windows you also want to add `-v -v -v -v` to the mtouch additional arguments by right-clicking the project in the solution explorer and selecting `Properties`.
Note: this is done automatically on Visual Studio for Mac when the log verbosity is set to diagnostic.

Easiest way to get exact version information:
- On Visual Studio for Mac: "Visual Studio" menu, "About Visual Studio" item, "Show Details" button.
- On Visual Studio for Windows: "Help menu", "About Microsoft Visual Studio" item.
Then copy/paste the version information (you can use the "Copy Information" button).
Comment 2 Lukas Lipka 2017-07-10 16:06:28 UTC
Visual Studio Community 2017 for Mac
Version 7.0.1 (build 24)
Installation UUID: ee4c7301-453c-4f43-a1e0-d189b864326d
Runtime:
	Mono 5.0.1.1 (2017-02/5077205) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 500010001

NuGet
Version: 4.0.0.2323

.NET Core
Runtime: /usr/local/share/dotnet/dotnet
SDK: /usr/local/share/dotnet/sdk/1.0.3/Sdks
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/msbuild/15.0/bin/Sdks

Xamarin.Profiler
Version: 1.5.4
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Apple Developer Tools
Xcode 8.3.3 (12175.1)
Build 8E3004b

Xamarin.Mac
Version: 3.4.0.36 (Visual Studio Community)

Xamarin.Android
Not Installed

Xamarin.iOS
Version: 10.10.0.36 (Visual Studio Community)
Hash: d2270eec
Branch: d15-2
Build date: 2017-05-22 16:30:53-0400

Xamarin Inspector
Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

Build Information
Release ID: 700010024
Git revision: 7ab1ca2ced6f584e56b7a0d4d321d00775cd95c9
Build date: 2017-05-19 05:44:51-04
Xamarin addins: 08d17158f3365beee5e60f67999e607cce4b3f93
Build lane: monodevelop-lion-d15-2

Operating System
Mac OS X 10.12.5
Darwin 16.6.0 Darwin Kernel Version 16.6.0
    Fri Apr 14 16:21:16 PDT 2017
    root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64
Comment 3 Lukas Lipka 2017-07-10 16:09:32 UTC
Created attachment 23454 [details]
Build log
Comment 4 Lukas Lipka 2017-07-10 16:10:45 UTC
Created attachment 23455 [details]
Test case (try with and without having the My Data Manager app installed)
Comment 5 Lukas Lipka 2017-07-10 16:12:12 UTC
Provided requested data.
Comment 6 Timothy Risi 2017-07-10 19:28:29 UTC
Thanks for the provided information and repro.  I'm able to reproduce it with the sample project.
Comment 7 Sebastien Pouliot 2017-07-11 12:31:01 UTC
-> BCL since native networking works fine

Note You need to log in before you can comment on or make changes to this bug.