X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem%2FSystem.Net%2FServicePointManager.cs;h=21de4e04e02fbe8f6e7bb1d3726c3c957e180929;hb=6b4c3f0d7247795b4e52e158df688895ff64884e;hp=85ab3a30bfad2dff73113c260559861294898fc8;hpb=9605c20c97099136ffde43fd7251f9fc6b8f24da;p=mono.git diff --git a/mcs/class/System/System.Net/ServicePointManager.cs b/mcs/class/System/System.Net/ServicePointManager.cs index 85ab3a30bfa..21de4e04e02 100644 --- a/mcs/class/System/System.Net/ServicePointManager.cs +++ b/mcs/class/System/System.Net/ServicePointManager.cs @@ -305,6 +305,8 @@ namespace System.Net throw new ArgumentNullException ("address"); RecycleServicePoints (); + + var origAddress = new Uri (address.Scheme + "://" + address.Authority); bool usesProxy = false; bool useConnect = false; @@ -323,7 +325,7 @@ namespace System.Net ServicePoint sp = null; lock (servicePoints) { - SPKey key = new SPKey (address, useConnect); + SPKey key = new SPKey (origAddress, useConnect); sp = servicePoints [key] as ServicePoint; if (sp != null) return sp; @@ -456,7 +458,14 @@ namespace System.Net SslPolicyErrors errors = 0; X509Chain chain = null; bool result = false; -#if !MONOTOUCH +#if MONOTOUCH + // The X509Chain is not really usable with MonoTouch (since the decision is not based on this data) + // However if someone wants to override the results (good or bad) from iOS then they will want all + // the certificates that the server provided (which generally does not include the root) so, only + // if there's a user callback, we'll create the X509Chain but won't build it + // ref: https://bugzilla.xamarin.com/show_bug.cgi?id=7245 + if (cb != null) { +#endif chain = new X509Chain (); chain.ChainPolicy = new X509ChainPolicy (); chain.ChainPolicy.RevocationMode = revocation_mode; @@ -464,7 +473,9 @@ namespace System.Net X509Certificate2 c2 = new X509Certificate2 (certs [i].RawData); chain.ChainPolicy.ExtraStore.Add (c2); } - +#if MONOTOUCH + } +#else try { if (!chain.Build (leaf)) errors |= GetErrorsFromChain (chain);