Imported Upstream version 6.4.0.137

Former-commit-id: 943baa9f16a098c33e129777827f3a9d20da00d6
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-07-26 19:53:28 +00:00
parent e9207cf623
commit ef583813eb
2712 changed files with 74169 additions and 40587 deletions

View File

@ -179,6 +179,23 @@ namespace System.Net.Security
}
}
MNS.MonoSslServerAuthenticationOptions CreateAuthenticationOptions (SslServerAuthenticationOptions sslServerAuthenticationOptions)
{
if (sslServerAuthenticationOptions.ServerCertificate == null && sslServerAuthenticationOptions.ServerCertificateSelectionCallback == null && selectionCallback == null)
throw new ArgumentNullException (nameof (sslServerAuthenticationOptions.ServerCertificate));
if ((sslServerAuthenticationOptions.ServerCertificate != null || selectionCallback != null) && sslServerAuthenticationOptions.ServerCertificateSelectionCallback != null)
throw new InvalidOperationException (SR.Format (SR.net_conflicting_options, nameof (ServerCertificateSelectionCallback)));
var options = new MNS.MonoSslServerAuthenticationOptions (sslServerAuthenticationOptions);
var serverSelectionCallback = sslServerAuthenticationOptions.ServerCertificateSelectionCallback;
if (serverSelectionCallback != null)
options.ServerCertSelectionDelegate = (x) => serverSelectionCallback (this, x);
return options;
}
public virtual void AuthenticateAsClient (string targetHost)
{
Impl.AuthenticateAsClient (targetHost);
@ -290,7 +307,7 @@ namespace System.Net.Security
public Task AuthenticateAsServerAsync (SslServerAuthenticationOptions sslServerAuthenticationOptions, CancellationToken cancellationToken)
{
return Impl2.AuthenticateAsServerAsync (new MNS.MonoSslServerAuthenticationOptions (sslServerAuthenticationOptions), cancellationToken);
return Impl2.AuthenticateAsServerAsync (CreateAuthenticationOptions (sslServerAuthenticationOptions), cancellationToken);
}
public virtual Task ShutdownAsync ()
@ -358,6 +375,12 @@ namespace System.Net.Security
get { return Impl.KeyExchangeStrength; }
}
public SslApplicationProtocol NegotiatedApplicationProtocol {
get {
throw new PlatformNotSupportedException ("https://github.com/mono/mono/issues/12880");
}
}
public override bool CanSeek {
get { return false; }
}
@ -632,6 +655,10 @@ namespace System.Net.Security
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public SslApplicationProtocol NegotiatedApplicationProtocol {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override bool CanSeek {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}