{"action":"created","issue":{"url":"https://api.github.com/repos/mono/mono/issues/10192","repository_url":"https://api.github.com/repos/mono/mono","labels_url":"https://api.github.com/repos/mono/mono/issues/10192/labels{/name}","comments_url":"https://api.github.com/repos/mono/mono/issues/10192/comments","events_url":"https://api.github.com/repos/mono/mono/issues/10192/events","html_url":"https://github.com/mono/mono/issues/10192","id":352170760,"node_id":"MDU6SXNzdWUzNTIxNzA3NjA=","number":10192,"title":"SSL Fails on iOS - \"Error getting response stream (ReadDone1): ReceiveFailure\"","user":{"login":"mandel-macaque","id":2190086,"node_id":"MDQ6VXNlcjIxOTAwODY=","avatar_url":"https://avatars2.githubusercontent.com/u/2190086?v=4","gravatar_id":"","url":"https://api.github.com/users/mandel-macaque","html_url":"https://github.com/mandel-macaque","followers_url":"https://api.github.com/users/mandel-macaque/followers","following_url":"https://api.github.com/users/mandel-macaque/following{/other_user}","gists_url":"https://api.github.com/users/mandel-macaque/gists{/gist_id}","starred_url":"https://api.github.com/users/mandel-macaque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mandel-macaque/subscriptions","organizations_url":"https://api.github.com/users/mandel-macaque/orgs","repos_url":"https://api.github.com/users/mandel-macaque/repos","events_url":"https://api.github.com/users/mandel-macaque/events{/privacy}","received_events_url":"https://api.github.com/users/mandel-macaque/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-20T14:51:37Z","updated_at":"2018-08-20T14:51:40Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"_From @jawbrey on August 16, 2018 14:59_\n\n<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨 -->\r\n\r\n<!--\r\nPlease fill in the *entire* template below.\r\nThe template is designed to avoid unnecessary delays to confirm and fix reported issues. Issues with missing information generally end up with a `need-info` label and take significantly more time to fix. Please help us help you!\r\nFor more information see https://github.com/xamarin/xamarin-macios/wiki/Submitting-Bugs-&-Suggestions\r\nFor support requests use https://www.xamarin.com/support\r\n-->\r\n\r\nI have a client who has a fairly complex Forms app that relies on a WCF service backend.  For the past year+ they have let the iOS app go dormant while they focused on Android.\r\n\r\nNow they're trying to get iOS working again, and are running into this problem when communicating with the backend over SSL (non-SSL seems to work OK).  I have tried all three HTTP implementations available in iOS and all return the same error:\r\n\r\nSystem.Net.WebException: Error getting response stream (ReadDone1): ReceiveFailure ---> System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer. ---> System.Net.Sockets.SocketException: Connection reset by peer\r\n  at System.Net.Sockets.Socket.EndReceive (System.IAsyncResult asyncResult) [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/referencesource/System/net/System/Net/Sockets/Socket.cs:4522\r\n\r\nI've found a lot of discussion online about similar errors, but nothing that clearly points me to how to FIX or WORKAROUND this problem.  And some of the discussion gets into the weeds of SSL/TLS which, frankly, makes my brain hurt.  Our server, to the best of my knowledge, is patched up to support all the latest protocols.  But its certainly possible that I've missed some bit of networking security nuance.\r\n\r\n\r\n### Steps to Reproduce\r\n\r\n1. build attached SSLTest project\r\n2. click SSL button\r\n3. in ViewController Client_LoginCompleted() see failure response \r\n\r\n### Expected Behavior\r\n\r\nShould return without an exception\r\n\r\n### Actual Behavior\r\n\r\nSystem.Net.WebException: Error getting response stream (ReadDone1): ReceiveFailure ---> System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer. ---> System.Net.Sockets.SocketException: Connection reset by peer\r\n  at System.Net.Sockets.Socket.EndReceive (System.IAsyncResult asyncResult) [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/referencesource/System/net/System/Net/Sockets/Socket.cs:4522\r\n### Environment\r\n\r\n<!--\r\n1.\r\nVisual Studio: Help > About Microsoft Visual Studio > Copy Info [button]\r\nVisual Studio for Mac: Visual Studio > About Visual Studio > Show Details > Copy Information [button]\r\n2. Paste into the code block below (between ```)\r\n-->\r\n\r\n```\r\n\r\n=== Visual Studio Enterprise 2017 for Mac ===\r\n\r\nVersion 7.5.4 (build 3)\r\nInstallation UUID: aee2c683-5cb4-4bdb-9a90-c6e3383bcb2d\r\nRuntime:\r\n\tMono 5.10.1.57 (2017-12/ea8a24b1bbf) (64-bit)\r\n\tGTK+ 2.24.23 (Raleigh theme)\r\n\tXamarin.Mac 4.4.1.178 (master / eeaeb7e6)\r\n\r\n\tPackage version: 510010057\r\n\r\n=== NuGet ===\r\n\r\nVersion: 4.3.1.4445\r\n\r\n=== .NET Core ===\r\n\r\nRuntime: /usr/local/share/dotnet/dotnet\r\nRuntime Version: 2.1.1\r\nSDK: /usr/local/share/dotnet/sdk/2.1.301/Sdks\r\nSDK Version: 2.1.301\r\nMSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.10.1/lib/mono/msbuild/15.0/bin/Sdks\r\n\r\n=== Xamarin.Profiler ===\r\n\r\nVersion: 1.6.2\r\nLocation: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler\r\n\r\n=== Xamarin.Android ===\r\n\r\nVersion: 8.3.3.2 (Visual Studio Enterprise)\r\nAndroid SDK: /Users/jason/Library/Developer/Xamarin/android-sdk-macosx\r\n\tSupported Android versions:\r\n\t\t6.0 (API level 23)\r\n\t\t8.1 (API level 27)\r\n\r\nSDK Tools Version: 26.1.1\r\nSDK Platform Tools Version: 27.0.1\r\nSDK Build Tools Version: 27.0.3\r\n\r\nJava SDK: /usr\r\njava version \"1.8.0_131\"\r\nJava(TM) SE Runtime Environment (build 1.8.0_131-b11)\r\nJava HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)\r\n\r\nAndroid Designer EPL code available here:\r\nhttps://github.com/xamarin/AndroidDesigner.EPL\r\n\r\n=== Xamarin Inspector ===\r\n\r\nVersion: 1.4.0\r\nHash: b3f92f9\r\nBranch: master\r\nBuild date: Fri, 19 Jan 2018 22:00:34 GMT\r\nClient compatibility: 1\r\n\r\n=== Apple Developer Tools ===\r\n\r\nXcode 9.4.1 (14161)\r\nBuild 9F2000\r\n\r\n=== Xamarin.Mac ===\r\n\r\nVersion: 4.4.1.193 (Visual Studio Enterprise)\r\n\r\n=== Xamarin.iOS ===\r\n\r\nVersion: 11.12.0.4 (Visual Studio Enterprise)\r\nHash: 64fece5f\r\nBranch: d15-7\r\nBuild date: 2018-05-29 20:00:44-0400\r\n\r\n=== Build Information ===\r\n\r\nRelease ID: 705040003\r\nGit revision: 6ae731889c896d6733efb8ff5117f5bf5b17b509\r\nBuild date: 2018-07-19 13:07:45-04\r\nXamarin addins: 417fed09624e1e1f76ab0a11e8b97ffd8bbf91e1\r\nBuild lane: monodevelop-lion-d15-7\r\n\r\n=== Operating System ===\r\n\r\nMac OS X 10.13.6\r\nDarwin 17.7.0 Darwin Kernel Version 17.7.0\r\n    Fri Jul  6 19:54:51 PDT 2018\r\n    root:xnu-4570.71.3~2/RELEASE_X86_64 x86_64\r\n\r\n\r\n\r\n```\r\n\r\n### Build Logs\r\n\r\n<!--\r\n1. Place cursor below this comment block.\r\n2. Attach build log or link to gist (https://gist.github.com/) of the log.\r\n-->\r\n\r\n[ssltest.logs.zip](https://github.com/xamarin/xamarin-macios/files/2294121/ssltest.logs.zip)\r\n\r\n### Example Project (If Possible)\r\n\r\n<!--\r\n1. Place cursor below this comment block.\r\n2. Drag and drop the compressed project or files needed to reproduce.\r\n-->\r\n\r\n[ssltest.zip](https://github.com/xamarin/xamarin-macios/files/2294126/ssltest.zip)\r\n\r\n<!--\r\nSwitch to the \"Preview\" tab to ensure your issue renders correctly.\r\n-->\r\n\n\n_Copied from original issue: xamarin/xamarin-macios#4631_"},"comment":{"url":"https://api.github.com/repos/mono/mono/issues/comments/414343959","html_url":"https://github.com/mono/mono/issues/10192#issuecomment-414343959","issue_url":"https://api.github.com/repos/mono/mono/issues/10192","id":414343959,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDM0Mzk1OQ==","user":{"login":"mandel-macaque","id":2190086,"node_id":"MDQ6VXNlcjIxOTAwODY=","avatar_url":"https://avatars2.githubusercontent.com/u/2190086?v=4","gravatar_id":"","url":"https://api.github.com/users/mandel-macaque","html_url":"https://github.com/mandel-macaque","followers_url":"https://api.github.com/users/mandel-macaque/followers","following_url":"https://api.github.com/users/mandel-macaque/following{/other_user}","gists_url":"https://api.github.com/users/mandel-macaque/gists{/gist_id}","starred_url":"https://api.github.com/users/mandel-macaque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mandel-macaque/subscriptions","organizations_url":"https://api.github.com/users/mandel-macaque/orgs","repos_url":"https://api.github.com/users/mandel-macaque/repos","events_url":"https://api.github.com/users/mandel-macaque/events{/privacy}","received_events_url":"https://api.github.com/users/mandel-macaque/received_events","type":"User","site_admin":false},"created_at":"2018-08-20T14:51:39Z","updated_at":"2018-08-20T14:51:39Z","author_association":"CONTRIBUTOR","body":"_From @migueldeicaza on August 17, 2018 20:2_\n\nChanging the HTTP networking stack will only change the implementation used in HttpClient, it does not solve the problem with HttpWebRequest, which is what this WCF code is using.\r\n\r\nThere are two paths forward:\r\n\r\n(a) You can make sure that you are using the Apple native TLS stack, configure the properties to pass to \"mtouch\" in iOS build pane to include `--tls-provider=appletls`.   This will make Xamarin use the Apple TLS provider rather than the old TLS 1.0 provider.\r\n\r\n(b) You should switch to the WCF from a NuGet package that uses `HttpClient` instead of `HttpWebRequest`, to benefit from the setting in the IDE ."}}
{"actor":{"display_login":"mandel-macaque"}}