Imported Upstream version 4.3.2.467

Former-commit-id: 9c2cb47f45fa221e661ab616387c9cda183f283d
This commit is contained in:
Xamarin Public Jenkins
2016-02-22 11:00:01 -05:00
parent f302175246
commit f3e3aab35a
4097 changed files with 122406 additions and 82300 deletions

View File

@ -31,6 +31,15 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if SECURITY_DEP
#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
using MonoSecurity::Mono.Security.Interface;
#else
using Mono.Security.Interface;
#endif
#endif
using System;
using System.Collections;
using System.Configuration;
@ -39,11 +48,13 @@ using System.IO;
using System.Net;
using System.Net.Cache;
using System.Net.Sockets;
using System.Net.Security;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Serialization;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using Mono.Net.Security;
namespace System.Net
{
@ -101,6 +112,11 @@ namespace System.Net
int maxResponseHeadersLength;
static int defaultMaxResponseHeadersLength;
int readWriteTimeout = 300000; // ms
IMonoTlsProvider tlsProvider;
#if SECURITY_DEP
MonoTlsSettings tlsSettings;
#endif
ServerCertValidationCallback certValidationCallback;
enum NtlmAuthState {
None,
@ -143,6 +159,15 @@ namespace System.Net
ThrowOnError = true;
ResetAuthorization ();
}
#if SECURITY_DEP
internal HttpWebRequest (Uri uri, IMonoTlsProvider tlsProvider, MonoTlsSettings settings = null)
: this (uri)
{
this.tlsProvider = tlsProvider;
this.tlsSettings = settings;
}
#endif
[Obsolete ("Serialization is obsoleted for this type", false)]
protected HttpWebRequest (SerializationInfo serializationInfo, StreamingContext streamingContext)
@ -240,20 +265,30 @@ namespace System.Net
method != "TRACE";
}
}
internal IMonoTlsProvider TlsProvider {
get { return tlsProvider; }
}
#if SECURITY_DEP
internal MonoTlsSettings TlsSettings {
get { return tlsSettings; }
}
#endif
public X509CertificateCollection ClientCertificates {
get {
if (certificates == null)
certificates = new X509CertificateCollection ();
return certificates;
}
[MonoTODO]
set {
throw GetMustImplement ();
if (value == null)
throw new ArgumentNullException ("value");
certificates = value;
}
}
public string Connection {
get { return webHeaders ["Connection"]; }
set {
@ -666,7 +701,26 @@ namespace System.Net
internal bool ProxyQuery {
get { return servicePoint.UsesProxy && !servicePoint.UseConnect; }
}
internal ServerCertValidationCallback ServerCertValidationCallback {
get { return certValidationCallback; }
}
public RemoteCertificateValidationCallback ServerCertificateValidationCallback {
get {
if (certValidationCallback == null)
return null;
return certValidationCallback.ValidationCallback;
}
set
{
if (value == null)
certValidationCallback = null;
else
certValidationCallback = new ServerCertValidationCallback (value);
}
}
// Methods
internal ServicePoint GetServicePoint ()