| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726 |
- //
- // SslStream.cs
- //
- // Author:
- // Martin Baulig <[email protected]>
- //
- // Copyright (c) 2015 Xamarin, Inc.
- //
- // Permission is hereby granted, free of charge, to any person obtaining a copy
- // of this software and associated documentation files (the "Software"), to deal
- // in the Software without restriction, including without limitation the rights
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- // copies of the Software, and to permit persons to whom the Software is
- // furnished to do so, subject to the following conditions:
- //
- // The above copyright notice and this permission notice shall be included in
- // all copies or substantial portions of the Software.
- //
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- // THE SOFTWARE.
- #if SECURITY_DEP
- #if MONO_SECURITY_ALIAS
- extern alias MonoSecurity;
- #endif
- #if MONO_SECURITY_ALIAS
- using MonoSecurity::Mono.Security.Interface;
- #else
- using Mono.Security.Interface;
- #endif
- using CipherAlgorithmType = System.Security.Authentication.CipherAlgorithmType;
- using HashAlgorithmType = System.Security.Authentication.HashAlgorithmType;
- using ExchangeAlgorithmType = System.Security.Authentication.ExchangeAlgorithmType;
- #endif
- using System.IO;
- using System.Net;
- using System.Net.Security;
- using System.Security.Authentication;
- using System.Security.Cryptography.X509Certificates;
- using System.Security.Permissions;
- using System.Security.Principal;
- using System.Security.Cryptography;
- using System.Threading;
- using System.Threading.Tasks;
- using MNS = Mono.Net.Security;
- namespace System.Net.Security
- {
- public delegate X509Certificate ServerCertificateSelectionCallback (object sender, string hostName);
- /*
- * Internal delegates from the referencesource / corefx.
- */
- internal delegate bool RemoteCertValidationCallback (
- string host,
- X509Certificate certificate,
- X509Chain chain,
- SslPolicyErrors sslPolicyErrors);
- internal delegate X509Certificate LocalCertSelectionCallback (
- string targetHost,
- X509CertificateCollection localCertificates,
- X509Certificate remoteCertificate,
- string[] acceptableIssuers);
- internal delegate X509Certificate ServerCertSelectionCallback (string hostName);
- public class SslStream : AuthenticatedStream
- {
- #if SECURITY_DEP
- MonoTlsProvider provider;
- MonoTlsSettings settings;
- RemoteCertificateValidationCallback validationCallback;
- LocalCertificateSelectionCallback selectionCallback;
- bool explicitSettings;
- IMonoSslStream impl;
- internal IMonoSslStream Impl {
- get {
- CheckDisposed ();
- return impl;
- }
- }
- IMonoSslStream2 Impl2 => (IMonoSslStream2)Impl;
- internal MonoTlsProvider Provider {
- get {
- CheckDisposed ();
- return provider;
- }
- }
- static MonoTlsProvider GetProvider ()
- {
- return MonoTlsProviderFactory.GetProvider ();
- }
- public SslStream (Stream innerStream)
- : this (innerStream, false)
- {
- }
- public SslStream (Stream innerStream, bool leaveInnerStreamOpen)
- : base (innerStream, leaveInnerStreamOpen)
- {
- provider = GetProvider ();
- settings = MonoTlsSettings.CopyDefaultSettings ();
- impl = provider.CreateSslStreamInternal (this, innerStream, leaveInnerStreamOpen, settings);
- }
- public SslStream (Stream innerStream, bool leaveInnerStreamOpen, RemoteCertificateValidationCallback userCertificateValidationCallback)
- : this (innerStream, leaveInnerStreamOpen, userCertificateValidationCallback, null)
- {
- }
- public SslStream (Stream innerStream, bool leaveInnerStreamOpen, RemoteCertificateValidationCallback userCertificateValidationCallback, LocalCertificateSelectionCallback userCertificateSelectionCallback)
- : base (innerStream, leaveInnerStreamOpen)
- {
- provider = GetProvider ();
- settings = MonoTlsSettings.CopyDefaultSettings ();
- SetAndVerifyValidationCallback (userCertificateValidationCallback);
- SetAndVerifySelectionCallback (userCertificateSelectionCallback);
- impl = provider.CreateSslStream (innerStream, leaveInnerStreamOpen, settings);
- }
- [MonoLimitation ("encryptionPolicy is ignored")]
- public SslStream (Stream innerStream, bool leaveInnerStreamOpen, RemoteCertificateValidationCallback userCertificateValidationCallback, LocalCertificateSelectionCallback userCertificateSelectionCallback, EncryptionPolicy encryptionPolicy)
- : this (innerStream, leaveInnerStreamOpen, userCertificateValidationCallback, userCertificateSelectionCallback)
- {
- }
- internal SslStream (Stream innerStream, bool leaveInnerStreamOpen, MonoTlsProvider provider, MonoTlsSettings settings)
- : base (innerStream, leaveInnerStreamOpen)
- {
- this.provider = provider;
- this.settings = settings.Clone ();
- explicitSettings = true;
- impl = provider.CreateSslStreamInternal (this, innerStream, leaveInnerStreamOpen, settings);
- }
- internal static IMonoSslStream CreateMonoSslStream (Stream innerStream, bool leaveInnerStreamOpen, MonoTlsProvider provider, MonoTlsSettings settings)
- {
- var sslStream = new SslStream (innerStream, leaveInnerStreamOpen, provider, settings);
- return sslStream.Impl;
- }
- void SetAndVerifyValidationCallback (RemoteCertificateValidationCallback callback)
- {
- if (validationCallback == null) {
- validationCallback = callback;
- settings.RemoteCertificateValidationCallback = MNS.Private.CallbackHelpers.PublicToMono (callback);
- } else if ((callback != null && validationCallback != callback) || (explicitSettings & settings.RemoteCertificateValidationCallback != null)) {
- throw new InvalidOperationException (SR.Format (SR.net_conflicting_options, nameof (RemoteCertificateValidationCallback)));
- }
- }
- void SetAndVerifySelectionCallback (LocalCertificateSelectionCallback callback)
- {
- if (selectionCallback == null) {
- selectionCallback = callback;
- if (callback == null)
- settings.ClientCertificateSelectionCallback = null;
- else
- settings.ClientCertificateSelectionCallback = (t, lc, rc, ai) => callback (this, t, lc, rc, ai);
- } else if ((callback != null && selectionCallback != callback) || (explicitSettings && settings.ClientCertificateSelectionCallback != null)) {
- throw new InvalidOperationException (SR.Format (SR.net_conflicting_options, nameof (LocalCertificateSelectionCallback)));
- }
- }
- public virtual void AuthenticateAsClient (string targetHost)
- {
- Impl.AuthenticateAsClient (targetHost);
- }
- public virtual void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, bool checkCertificateRevocation)
- {
- Impl.AuthenticateAsClient (targetHost, clientCertificates, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation);
- }
- public virtual void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
- {
- Impl.AuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
- }
- public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState)
- {
- return Impl.BeginAuthenticateAsClient (targetHost, asyncCallback, asyncState);
- }
- public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
- {
- return Impl.BeginAuthenticateAsClient (targetHost, clientCertificates, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation, asyncCallback, asyncState);
- }
- public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
- {
- return Impl.BeginAuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
- }
- public virtual void EndAuthenticateAsClient (IAsyncResult asyncResult)
- {
- Impl.EndAuthenticateAsClient (asyncResult);
- }
- public virtual void AuthenticateAsServer (X509Certificate serverCertificate)
- {
- Impl.AuthenticateAsServer (serverCertificate);
- }
- public virtual void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation)
- {
- Impl.AuthenticateAsServer (serverCertificate, clientCertificateRequired, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation);
- }
- public virtual void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
- {
- Impl.AuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
- }
- public virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState)
- {
- return Impl.BeginAuthenticateAsServer (serverCertificate, asyncCallback, asyncState);
- }
- public virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
- {
- return Impl.BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation, asyncCallback, asyncState);
- }
- public virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
- {
- return Impl.BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
- }
- public virtual void EndAuthenticateAsServer (IAsyncResult asyncResult)
- {
- Impl.EndAuthenticateAsServer (asyncResult);
- }
- public TransportContext TransportContext => null;
- public virtual Task AuthenticateAsClientAsync (string targetHost)
- {
- return Impl.AuthenticateAsClientAsync (targetHost);
- }
- public virtual Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, bool checkCertificateRevocation)
- {
- return Impl.AuthenticateAsClientAsync (targetHost, clientCertificates, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation);
- }
- public virtual Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
- {
- return Impl.AuthenticateAsClientAsync (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
- }
- public Task AuthenticateAsClientAsync (SslClientAuthenticationOptions sslClientAuthenticationOptions, CancellationToken cancellationToken)
- {
- SetAndVerifyValidationCallback (sslClientAuthenticationOptions.RemoteCertificateValidationCallback);
- SetAndVerifySelectionCallback (sslClientAuthenticationOptions.LocalCertificateSelectionCallback);
- return Impl2.AuthenticateAsClientAsync (new MNS.MonoSslClientAuthenticationOptions (sslClientAuthenticationOptions), cancellationToken);
- }
- public virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate)
- {
- return Impl.AuthenticateAsServerAsync (serverCertificate);
- }
- public virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation)
- {
- return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation);
- }
- public virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
- {
- return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
- }
- public Task AuthenticateAsServerAsync (SslServerAuthenticationOptions sslServerAuthenticationOptions, CancellationToken cancellationToken)
- {
- return Impl2.AuthenticateAsServerAsync (new MNS.MonoSslServerAuthenticationOptions (sslServerAuthenticationOptions), cancellationToken);
- }
- public virtual Task ShutdownAsync ()
- {
- return Impl.ShutdownAsync ();
- }
- public override bool IsAuthenticated {
- get { return Impl.IsAuthenticated; }
- }
- public override bool IsMutuallyAuthenticated {
- get { return Impl.IsMutuallyAuthenticated; }
- }
- public override bool IsEncrypted {
- get { return Impl.IsEncrypted; }
- }
- public override bool IsSigned {
- get { return Impl.IsSigned; }
- }
- public override bool IsServer {
- get { return Impl.IsServer; }
- }
- public virtual SslProtocols SslProtocol {
- get { return (SslProtocols)Impl.SslProtocol; }
- }
- public virtual bool CheckCertRevocationStatus {
- get { return Impl.CheckCertRevocationStatus; }
- }
- public virtual X509Certificate LocalCertificate {
- get { return Impl.LocalCertificate; }
- }
- public virtual X509Certificate RemoteCertificate {
- get { return Impl.RemoteCertificate; }
- }
- public virtual CipherAlgorithmType CipherAlgorithm {
- get { return (CipherAlgorithmType)Impl.CipherAlgorithm; }
- }
- public virtual int CipherStrength {
- get { return Impl.CipherStrength; }
- }
- public virtual HashAlgorithmType HashAlgorithm {
- get { return (HashAlgorithmType)Impl.HashAlgorithm; }
- }
- public virtual int HashStrength {
- get { return Impl.HashStrength; }
- }
- public virtual ExchangeAlgorithmType KeyExchangeAlgorithm {
- get { return (ExchangeAlgorithmType)Impl.KeyExchangeAlgorithm; }
- }
- public virtual int KeyExchangeStrength {
- get { return Impl.KeyExchangeStrength; }
- }
- public override bool CanSeek {
- get { return false; }
- }
- public override bool CanRead {
- get { return impl != null && impl.CanRead; }
- }
- public override bool CanTimeout {
- get { return InnerStream.CanTimeout; }
- }
- public override bool CanWrite {
- get { return impl != null && impl.CanWrite; }
- }
- public override int ReadTimeout {
- get { return Impl.ReadTimeout; }
- set { Impl.ReadTimeout = value; }
- }
- public override int WriteTimeout {
- get { return Impl.WriteTimeout; }
- set { Impl.WriteTimeout = value; }
- }
- public override long Length {
- get { return Impl.Length; }
- }
- public override long Position {
- get { return Impl.Position; }
- set {
- throw new NotSupportedException (SR.GetString (SR.net_noseek));
- }
- }
- public override void SetLength (long value)
- {
- Impl.SetLength (value);
- }
- public override long Seek (long offset, SeekOrigin origin)
- {
- throw new NotSupportedException (SR.GetString (SR.net_noseek));
- }
- public override Task FlushAsync (CancellationToken cancellationToken)
- {
- return InnerStream.FlushAsync (cancellationToken);
- }
- public override void Flush ()
- {
- InnerStream.Flush ();
- }
- void CheckDisposed ()
- {
- if (impl == null)
- throw new ObjectDisposedException ("SslStream");
- }
- protected override void Dispose (bool disposing)
- {
- try {
- if (impl != null && disposing) {
- impl.Dispose ();
- impl = null;
- }
- } finally {
- base.Dispose (disposing);
- }
- }
- public override int Read (byte[] buffer, int offset, int count)
- {
- return Impl.Read (buffer, offset, count);
- }
- public void Write (byte[] buffer)
- {
- Impl.Write (buffer);
- }
- public override void Write (byte[] buffer, int offset, int count)
- {
- Impl.Write (buffer, offset, count);
- }
- // [HostProtection (ExternalThreading=true)]
- public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
- {
- return Impl.BeginRead (buffer, offset, count, asyncCallback, asyncState);
- }
- public override int EndRead (IAsyncResult asyncResult)
- {
- return Impl.EndRead (asyncResult);
- }
- // [HostProtection (ExternalThreading=true)]
- public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
- {
- return Impl.BeginWrite (buffer, offset, count, asyncCallback, asyncState);
- }
- public override void EndWrite (IAsyncResult asyncResult)
- {
- Impl.EndWrite (asyncResult);
- }
- #else // !SECURITY_DEP
- const string EXCEPTION_MESSAGE = "System.Net.Security.SslStream is not supported on the current platform.";
- public SslStream (Stream innerStream)
- : this (innerStream, false)
- {
- }
- public SslStream (Stream innerStream, bool leaveInnerStreamOpen)
- : base (innerStream, leaveInnerStreamOpen)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public SslStream (Stream innerStream, bool leaveInnerStreamOpen, RemoteCertificateValidationCallback userCertificateValidationCallback)
- : this (innerStream, leaveInnerStreamOpen)
- {
- }
- public SslStream (Stream innerStream, bool leaveInnerStreamOpen, RemoteCertificateValidationCallback userCertificateValidationCallback, LocalCertificateSelectionCallback userCertificateSelectionCallback)
- : this (innerStream, leaveInnerStreamOpen)
- {
- }
- public SslStream (Stream innerStream, bool leaveInnerStreamOpen, RemoteCertificateValidationCallback userCertificateValidationCallback, LocalCertificateSelectionCallback userCertificateSelectionCallback, EncryptionPolicy encryptionPolicy)
- : this (innerStream, leaveInnerStreamOpen)
- {
- }
- public virtual void AuthenticateAsClient (string targetHost)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public virtual void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public virtual void EndAuthenticateAsClient (IAsyncResult asyncResult)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public virtual void AuthenticateAsServer (X509Certificate serverCertificate)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public virtual void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public virtual void EndAuthenticateAsServer (IAsyncResult asyncResult)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public TransportContext TransportContext {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public virtual Task AuthenticateAsClientAsync (string targetHost)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public virtual Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public override bool IsAuthenticated {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public override bool IsMutuallyAuthenticated {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public override bool IsEncrypted {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public override bool IsSigned {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public override bool IsServer {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public virtual SslProtocols SslProtocol {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public virtual bool CheckCertRevocationStatus {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public virtual X509Certificate LocalCertificate {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public virtual X509Certificate RemoteCertificate {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public virtual CipherAlgorithmType CipherAlgorithm {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public virtual int CipherStrength {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public virtual HashAlgorithmType HashAlgorithm {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public virtual int HashStrength {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public virtual ExchangeAlgorithmType KeyExchangeAlgorithm {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public virtual int KeyExchangeStrength {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public override bool CanSeek {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public override bool CanRead {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public override bool CanTimeout {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public override bool CanWrite {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public override int ReadTimeout {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public override int WriteTimeout {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public override long Length {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public override long Position {
- get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
- }
- public override void SetLength (long value)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public override long Seek (long offset, SeekOrigin origin)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public override void Flush ()
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- protected override void Dispose (bool disposing)
- {
- }
- public override int Read (byte[] buffer, int offset, int count)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public void Write (byte[] buffer)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public override void Write (byte[] buffer, int offset, int count)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public override int EndRead (IAsyncResult asyncResult)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- public override void EndWrite (IAsyncResult asyncResult)
- {
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
- }
- #endif
- public SslApplicationProtocol NegotiatedApplicationProtocol => throw new PlatformNotSupportedException();
- }
- }
|