Beispiel #1
0
 public SslStream(Stream innerStream, bool leaveInnerStreamOpen)
     : base(innerStream, leaveInnerStreamOpen)
 {
     provider = GetProvider();
     settings = MonoTlsSettings.CopyDefaultSettings();
     impl     = provider.CreateSslStream(this, innerStream, leaveInnerStreamOpen, settings);
 }
Beispiel #2
0
 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(this, innerStream, leaveInnerStreamOpen, settings);
 }
Beispiel #3
0
        public SslStream(Stream innerStream, bool leaveInnerStreamOpen)
            : base(innerStream, leaveInnerStreamOpen)
        {
#if WASM
            try {
                provider = GetProvider();
            } catch (Exception ex) {
                throw new PlatformNotSupportedException("System.Net.Security.SslStream is not supported on the current platform.", ex);
            }
#else
            provider = GetProvider();
#endif
            settings = MonoTlsSettings.CopyDefaultSettings();
            impl     = provider.CreateSslStream(this, innerStream, leaveInnerStreamOpen, settings);
        }
Beispiel #4
0
        public SslStream(Stream innerStream, bool leaveInnerStreamOpen, RemoteCertificateValidationCallback userCertificateValidationCallback, LocalCertificateSelectionCallback userCertificateSelectionCallback)
            : base(innerStream, leaveInnerStreamOpen)
        {
#if WASM
            try {
                provider = GetProvider();
            } catch (Exception ex) {
                throw new PlatformNotSupportedException("System.Net.Security.SslStream is not supported on the current platform.", ex);
            }
#else
            provider = GetProvider();
#endif
            settings = MonoTlsSettings.CopyDefaultSettings();
            SetAndVerifyValidationCallback(userCertificateValidationCallback);
            SetAndVerifySelectionCallback(userCertificateSelectionCallback);
            impl = provider.CreateSslStream(this, innerStream, leaveInnerStreamOpen, settings);
        }