示例#1
0
        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);
        }
示例#2
0
        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
        }
示例#3
0
        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
        }
示例#4
0
        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);
        }