Bug 2492 - SocketException thrown using WebClient and HttpWebRequest for https addresses
Summary: SocketException thrown using WebClient and HttpWebRequest for https addresses
Status: RESOLVED INVALID
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 4.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-12-14 04:52 UTC by Peter Davis
Modified: 2012-05-15 13:22 UTC (History)
3 users (show)

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


Attachments
Socket exception test (23.11 KB, application/octet-stream)
2012-05-15 05:08 UTC, Michal Dobrodenka
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Peter Davis 2011-12-14 04:52:10 UTC
The following exception was thrown when using the following code:

var s = webClient.DownloadString("https://www.google.com");

An address incompatible with the requested protocol was used
  at System.Net.Sockets.Socket..ctor (AddressFamily family, SocketType type, ProtocolType proto) [0x00051] in /home/jon/Development/xamarin/mono/mcs/class/System/System.Net.Sockets/Socket_2_1.cs:931 
  at System.Net.Sockets.Socket.CheckProtocolSupport () [0x00046] in /home/jon/Development/xamarin/mono/mcs/class/System/System.Net.Sockets/Socket_2_1.cs:804 



Version info:

MonoDevelop 2.8.4.2
Installation UUID: 37e9a8d1-7ef5-4d73-a781-cdea80a47f68
Runtime:
	Mono 2.10.6 (tarball Fri Sep 16 00:13:06 EDT 2011)
	GTK 2.24.5
	GTK# (2.12.0.0)
Apple Developer Tools:
	(Not Found)

Monotouch: 
Mono for Android: 4.0.0.60565479 (Evaluation)
Build information:
	Release ID: 20804002
	Git revision: 2ab093b0282d817f804c88e8a8ac37bd9aaab289
	Build date: 2011-12-06 19:58:51+0000
Operating System:
	Mac OS X 10.6.8
	Darwin Megan-Pearces-MacBook-Pro.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386
Loaded assemblies:
mdhost                                     1.0.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/bin/mdhost.exe
MonoDevelop.Database.ConnectionManager     2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Database/MonoDevelop.Database.ConnectionManager.dll
MonoDevelop.RegexToolkit                   2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.dll
System.Web                                 4.0.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/System.Web/4.0.0.0__b03f5f7f11d50a3a/System.Web.dll
ICSharpCode.Decompiler                     1.0.4357.26912 /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/bin/ICSharpCode.Decompiler.dll
MonoDevelop.Database.CodeGenerator         2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Database/MonoDevelop.Database.CodeGenerator.dll
MonoDeveloperExtensions_nunit              0.0.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDeveloperExtensions/MonoDeveloperExtensions_nunit.dll
MonoDevelop.DocFood                        1.0.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.DocFood.dll
MonoDevelop.WebReferences                  2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.WebReferences/MonoDevelop.WebReferences.dll
MonoDevelop.AspNet.Mvc                     2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.AspNet.Mvc/MonoDevelop.AspNet.Mvc.dll
MonoDevelop.CodeMetrics                    2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.CodeMetrics/MonoDevelop.CodeMetrics.dll
MonoDevelop.Debugger.Soft.MonoDroid        0.0.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoDroid/MonoDevelop.Debugger.Soft.MonoDroid.dll
MonoDevelop.Debugger.Soft.AspNet           0.0.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet.dll
MonoDevelop.Debugger.Soft.Moonlight        0.0.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.Moonlight.dll
MonoDevelop.Debugger.Soft.MonoMac          0.0.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoMac/MonoDevelop.Debugger.Soft.MonoMac.dll
MonoDevelop.Debugger.Soft                  2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.dll
Mono.Debugger.Soft                         0.0.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Debugger.Soft/Mono.Debugger.Soft.dll
Mono.Debugging.Soft                        0.0.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft.dll
Sharpen                                    1.0.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/VersionControl/Sharpen.dll
NGit                                       1.0.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/VersionControl/NGit.dll
MonoDevelop.VersionControl.Git             2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/VersionControl/MonoDevelop.VersionControl.Git.dll
MonoDevelop.VersionControl.Subversion.Unix 2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/VersionControl/MonoDevelop.VersionControl.Subversion.Unix.dll
MonoDevelop.VersionControl.Subversion      2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/VersionControl/MonoDevelop.VersionControl.Subversion.dll
I18N.Rare                                  4.0.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/I18N.Rare/4.0.0.0__0738eb9f132ed756/I18N.Rare.dll
I18N.CJK                                   4.0.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/I18N.CJK/4.0.0.0__0738eb9f132ed756/I18N.CJK.dll
I18N.MidEast                               4.0.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/I18N.MidEast/4.0.0.0__0738eb9f132ed756/I18N.MidEast.dll
I18N.Other                                 4.0.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/I18N.Other/4.0.0.0__0738eb9f132ed756/I18N.Other.dll
I18N.West                                  4.0.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/I18N.West/4.0.0.0__0738eb9f132ed756/I18N.West.dll
I18N                                       4.0.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/I18N/4.0.0.0__0738eb9f132ed756/I18N.dll
MonoDevelop.HexEditor                      2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.HexEditor.dll
MonoDevelop.AssemblyBrowser                2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.AssemblyBrowser.dll
MonoDevelop.Database.Sql.Sqlite            2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite.dll
MonoDevelop.Database.Sql.SqlServer         2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Database/MonoDevelop.Database.Sql.SqlServer.dll
MonoDevelop.Database.Sql.Npgsql            2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Database/MonoDevelop.Database.Sql.Npgsql.dll
MonoDevelop.Database.Sql.MySql             2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Database/MonoDevelop.Database.Sql.MySql.dll
MonoDevelop.Database.Designer              2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Database/MonoDevelop.Database.Designer.dll
MonoDevelop.TextTemplating                 2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.TextTemplating/MonoDevelop.TextTemplating.dll
Mono.TextTemplating                        0.0.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.TextTemplating/Mono.TextTemplating.dll
MonoDevelop.Database.Query                 2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Database/MonoDevelop.Database.Query.dll
MonoDevelop.Database.Components            2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Database/MonoDevelop.Database.Components.dll
MonoDevelop.Database.Sql                   2.2.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Database/MonoDevelop.Database.Sql.dll
System.Runtime.Remoting                    4.0.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/System.Runtime.Remoting/4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
Microsoft.Build.Framework                  3.5.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/Microsoft.Build.Framework/3.5.0.0__b03f5f7f11d50a3a/Microsoft.Build.Framework.dll
Microsoft.Build.Engine                     3.5.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/Microsoft.Build.Engine/3.5.0.0__b03f5f7f11d50a3a/Microsoft.Build.Engine.dll
MonoDevelop.Gettext                        2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Gettext/MonoDevelop.Gettext.dll
ChangeLogAddIn                             2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/ChangeLogAddIn/ChangeLogAddIn.dll
ILAsmBinding                               2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/BackendBindings/ILAsmBinding.dll
OldNRefactory                              2.1.1.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/bin/OldNRefactory.dll
ICSharpCode.NRefactory                     1.0.4357.26910 /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/bin/ICSharpCode.NRefactory.dll
MonoDevelop.CBinding                       2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/BackendBindings/MonoDevelop.CBinding.dll
MonoDevelop.Deployment.Linux               2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Deployment/MonoDevelop.Deployment.Linux.dll
MonoDevelop.Projects.Formats.MSBuild       1.0.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/bin/MonoDevelop.Projects.Formats.MSBuild.exe
MonoDevelop.Autotools                      2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Autotools/MonoDevelop.Autotools.dll
MonoDevelop.MonoMac                        2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoMac/MonoDevelop.MonoMac.dll
MonoDevelop.MsVisualStudio                 2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MsVisualStudio/MonoDevelop.MsVisualStudio.dll
MonoDevelop.VBNetBinding                   2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/BackendBindings/MonoDevelop.VBNetBinding.dll
MonoDevelop.CSharpBinding                  2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/BackendBindings/MonoDevelop.CSharpBinding.dll
MonoDevelop.Refactoring                    2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Refactoring/MonoDevelop.Refactoring.dll
ICSharpCode.SharpZipLib                    2.84.0.0       /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/ICSharpCode.SharpZipLib/2.84.0.0__1b03e6acf1164f73/ICSharpCode.SharpZipLib.dll
Mono.Security                              4.0.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll
MonoDevelop.GtkCore                        2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.GtkCore/MonoDevelop.GtkCore.dll
libsteticui                                0.0.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.GtkCore/libsteticui.dll
libstetic                                  0.0.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.GtkCore/libstetic.dll
Xamarin.Ide.Mac                            1.0.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/Xamarin.Ide/Xamarin.Ide.Mac.dll
nunit.util                                 2.4.8.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/NUnit/nunit.util.dll
nunit.framework                            2.4.8.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/NUnit/nunit.framework.dll
nunit.core.interfaces                      2.4.8.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/NUnit/nunit.core.interfaces.dll
nunit.core                                 2.4.8.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/NUnit/nunit.core.dll
MonoDevelop.NUnit                          2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/NUnit/MonoDevelop.NUnit.dll
Mono.Cairo                                 4.0.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/Mono.Cairo/4.0.0.0__0738eb9f132ed756/Mono.Cairo.dll
MonoDeveloperExtensions                    2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDeveloperExtensions/MonoDeveloperExtensions.dll
Mono.Debugging                             0.0.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/bin/Mono.Debugging.dll
pango-sharp                                2.12.0.0       /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/pango-sharp/2.12.0.0__35e10195dab3c99f/pango-sharp.dll
monodoc                                    1.0.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/monodoc/1.0.0.0__0738eb9f132ed756/monodoc.dll
MonoDevelop.Moonlight                      2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Moonlight/MonoDevelop.Moonlight.dll
MonoDevelop.AspNet                         2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.AspNet/MonoDevelop.AspNet.dll
MonoDevelop.XmlEditor                      2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor.dll
MonoDevelop.Deployment                     2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Deployment/MonoDevelop.Deployment.dll
System.Drawing                             4.0.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
Mono.Cecil                                 0.9.4.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/bin/Mono.Cecil.dll
MonoDevelop.MonoDroid                      3.9.9.1        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoDroid/MonoDevelop.MonoDroid.dll
Mono.AndroidTools                          0.9.3.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoDroid/Mono.AndroidTools.dll
MonoDevelop.IPhone                         2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.IPhone/MonoDevelop.IPhone.dll
MonoDevelop.MacDev                         2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MacDev/MonoDevelop.MacDev.dll
MonoDevelop.DesignerSupport                2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.dll
MacPlatform                                2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MacPlatform.dll
MonoMac                                    0.0.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoMac.dll
MonoDevelop.VersionControl                 2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/VersionControl/MonoDevelop.VersionControl.dll
MonoDevelop.SourceEditor2                  2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.SourceEditor2.dll
MonoDevelop.Debugger                       2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Debugger/MonoDevelop.Debugger.dll
Xamarin.Ide                                1.0.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/Xamarin.Ide/Xamarin.Ide.dll
System.Configuration                       4.0.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
gdk-sharp                                  2.12.0.0       /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/gdk-sharp/2.12.0.0__35e10195dab3c99f/gdk-sharp.dll
Mono.TextEditor                            1.0.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/bin/Mono.TextEditor.dll
atk-sharp                                  2.12.0.0       /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/atk-sharp/2.12.0.0__35e10195dab3c99f/atk-sharp.dll
gtk-sharp                                  2.12.0.0       /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/gtk-sharp/2.12.0.0__35e10195dab3c99f/gtk-sharp.dll
Mono.Posix                                 4.0.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll
Mono.Addins                                0.6.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/Mono.Addins/0.6.0.0__0738eb9f132ed756/Mono.Addins.dll
Mono.Addins.Setup                          0.6.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/Mono.Addins.Setup/0.6.0.0__0738eb9f132ed756/Mono.Addins.Setup.dll
System.Xml                                 4.0.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll
System.Xml.Linq                            4.0.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/System.Xml.Linq/4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll
System.Core                                4.0.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll
glib-sharp                                 2.12.0.0       /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/glib-sharp/2.12.0.0__35e10195dab3c99f/glib-sharp.dll
System                                     4.0.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll
MonoDevelop.Core                           2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/bin/MonoDevelop.Core.dll
MonoDevelop.Ide                            2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/bin/MonoDevelop.Ide.dll
MonoDevelop                                2.6.0.0        /Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/bin/MonoDevelop.exe
mscorlib                                   4.0.0.0        /Library/Frameworks/Mono.framework/Versions/2.10.6/lib/mono/4.0/mscorlib.dll
Comment 1 Michal Dobrodenka 2012-04-07 13:16:26 UTC
The same exception I got on this line

addr = Dns.GetHostAddresses(host);

Both on device and on emulator, version 4.0.6 and 4.10 alhpa.
Comment 2 Jonathan Pryor 2012-04-10 15:13:23 UTC
Do you have INTERNET permission?

Regarding the original report, the following works for me on a Debug build:

	var webClient = new WebClient();
	var s = webClient.DownloadString("https://www.google.com");
	Console.WriteLine ("read {0} chars!\n{1}", s.Length, s);

With respect to Comment #1, it works for me:

	var addrs = Dns.GetHostAddresses("www.google.com");
	foreach (var addr in addrs) {
		Console.WriteLine("address bytes: {0}",
				string.Join (" ", addr.GetAddressBytes().Select(b => b.ToString ("x"))));
	}

In a Release build, I get a SocketException from both calls until I add the required INTERNET permission, at which point both WebClient.DownloadString() and Dns.GetHostAddresses() work.
Comment 3 Jonathan Pryor 2012-04-10 15:16:54 UTC
Peter: Does your emulator have internet access? Specifically, can you open the Browser app within the emulator and access a web site?

If Browser is  unable to access a web site, you'll need to enable networking within the emulator by using Fn+F8:

    http://stackoverflow.com/a/2437915/83444
Comment 4 Michal Dobrodenka 2012-05-15 05:08:06 UTC
Created attachment 1889 [details]
Socket exception test
Comment 5 Michal Dobrodenka 2012-05-15 05:15:47 UTC
I've added simple exception test, tested in MfA 4.2.1, x86 emulator, VS2010, Debug->Exceptions->Break when CLR exceptions are thrown.

Program runs normally, just breaks on line:

var addr = Dns.GetHostAddresses("google.com");

with exception:
System.Net.Sockets.SocketException: An address incompatible with the requested protocol was used

Could this be considered as normal, since it breaks only when "Debug->Exceptions->Break when CLR exceptions are thrown" is on, it seems it is internal GetHostAddresses exception. Hostname is resolved normally.
Comment 6 Jonathan Pryor 2012-05-15 13:22:38 UTC
This is expected: The Socket static constructor tries to see if IPv4 and IPV6 are supported, which may result in thrown (and caught) exceptions:

https://github.com/mono/mono/blob/mono-2-10/mcs/class/System/System.Net.Sockets/Socket_2_1.cs#L771