Imported Upstream version 4.4.0.40

Former-commit-id: 6427cc082e74df30afc535fd906a3494b74b0817
This commit is contained in:
Xamarin Public Jenkins
2016-03-16 12:38:19 -04:00
parent f3e3aab35a
commit a632333cc7
110 changed files with 1496 additions and 556 deletions

View File

@ -114,7 +114,7 @@ namespace System.Net
// Static properties
private static ICertificatePolicy policy = new DefaultCertificatePolicy ();
private static ICertificatePolicy policy;
private static int defaultConnectionLimit = DefaultPersistentConnectionLimit;
private static int maxServicePointIdleTime = 100000; // 100 seconds
private static int maxServicePoints = 0;
@ -174,7 +174,11 @@ namespace System.Net
[Obsolete ("Use ServerCertificateValidationCallback instead", false)]
public static ICertificatePolicy CertificatePolicy {
get { return policy; }
get {
if (policy == null)
Interlocked.CompareExchange (ref policy, new DefaultCertificatePolicy (), null);
return policy;
}
set { policy = value; }
}
@ -328,7 +332,7 @@ namespace System.Net
usesProxy = true;
bool isSecure = address.Scheme == "https";
address = proxy.GetProxy (address);
if (address.Scheme != "http" && !isSecure)
if (address.Scheme != "http")
throw new NotSupportedException ("Proxy scheme not supported.");
if (isSecure && address.Scheme == "http")