private void InitializeAsServer(IRawByteClient client, X509Certificate certificate) { InitializeCommon(client, isClient: false); this.serverCertificate = certificate; this.clientStreamWrapper = new RawByteClientStream(this.client); this.sslStream = new SslStream( this.clientStreamWrapper, true); }
private void InitializeAsClient(IRawByteClient client, string targetHost, RemoteCertificateValidationCallback remoteCertificateValidationCallback) { InitializeCommon(client, isClient: true); this.targetHost = targetHost; this.clientStreamWrapper = new RawByteClientStream(this.client); #if !MONO this.sslStream = new SslStream( this.clientStreamWrapper, true, remoteCertificateValidationCallback, null, EncryptionPolicy.RequireEncryption); #else this.sslStream = new SslStream( this.clientStreamWrapper, true, remoteCertificateValidationCallback, null); #endif }