internal void ValidateCreateContext(bool serverMode, string targetHost, SslProtocols enabledProtocols, X509Certificate serverCertificate, X509CertificateCollection clientCertificates, bool clientCertRequired) { if (xobileTlsContext != null) { throw new InvalidOperationException(); } if (serverMode) { if (serverCertificate == null) { throw new ArgumentException("serverCertificate"); } } else { if (targetHost == null) { throw new ArgumentException("targetHost"); } if (targetHost.Length == 0) { targetHost = "?" + Interlocked.Increment(ref uniqueNameInteger).ToString(NumberFormatInfo.InvariantInfo); } } xobileTlsContext = new AppleTlsContext(this, Settings, Provider, serverMode, targetHost, enabledProtocols, serverCertificate, clientCertificates, clientCertRequired); }
protected override void Dispose(bool disposing) { try { lastException = new ObjectDisposedException("MobileAuthenticatedStream"); lock (ioLock) { if (xobileTlsContext != null) { xobileTlsContext.Dispose(); xobileTlsContext = null; } } } finally { base.Dispose(disposing); } }
AsyncOperationStatus ProcessClose(AsyncProtocolRequest asyncRequest, AsyncOperationStatus status) { Debug("ProcessClose: {0}", status); lock (ioLock) { if (xobileTlsContext == null) { return(AsyncOperationStatus.Complete); } xobileTlsContext.Close(); xobileTlsContext = null; return(AsyncOperationStatus.Continue); } }
AsyncOperationStatus ProcessClose(AsyncProtocolRequest asyncRequest, AsyncOperationStatus status) { Debug ("ProcessClose: {0}", status); lock (ioLock) { if (xobileTlsContext == null) return AsyncOperationStatus.Complete; xobileTlsContext.Close (); xobileTlsContext = null; return AsyncOperationStatus.Continue; } }
protected override void Dispose(bool disposing) { try { lastException = new ObjectDisposedException ("MobileAuthenticatedStream"); lock (ioLock) { if (xobileTlsContext != null) { xobileTlsContext.Dispose (); xobileTlsContext = null; } } } finally { base.Dispose (disposing); } }
internal void ValidateCreateContext(bool serverMode, string targetHost, SslProtocols enabledProtocols, X509Certificate serverCertificate, X509CertificateCollection clientCertificates, bool clientCertRequired) { if (xobileTlsContext != null) throw new InvalidOperationException (); if (serverMode) { if (serverCertificate == null) throw new ArgumentException ("serverCertificate"); } else { if (targetHost == null) throw new ArgumentException ("targetHost"); if (targetHost.Length == 0) targetHost = "?" + Interlocked.Increment (ref uniqueNameInteger).ToString (NumberFormatInfo.InvariantInfo); } xobileTlsContext = new AppleTlsContext (this, Settings, Provider, serverMode, targetHost, enabledProtocols, serverCertificate, clientCertificates, clientCertRequired); }