Example #1
0
        public static MonoNewTlsStream CreateServer(
            Stream innerStream, bool leaveOpen, RemoteCertificateValidationCallback certValidationCallback,
            LocalCertificateSelectionCallback certSelectionCallback, XEncryptionPolicy encryptionPolicy, TlsSettings settings,
            SSCX.X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
        {
            var stream = new MonoNewTlsStream(
                innerStream, leaveOpen,
                ConvertCallback(certValidationCallback),
                ConvertCallback(certSelectionCallback),
                (XEncryptionPolicy)encryptionPolicy,
                settings);

            try {
                stream.AuthenticateAsServer(serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
            } catch (Exception ex) {
                var tlsEx = stream.LastError;
                if (tlsEx != null)
                {
                    throw new AggregateException(ex, tlsEx);
                }
                throw;
            }

            return(stream);
        }
		public static MonoNewTlsStream CreateServer (
			Stream innerStream, bool leaveOpen, ICertificateValidator certificateValidator, TlsSettings settings,
			SSCX.X509Certificate serverCertificate, bool clientCertificateRequired,
			SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
		{
			var stream = new MonoNewTlsStream (innerStream, leaveOpen, certificateValidator, settings);

			try {
				stream.AuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
			} catch (Exception ex) {
				var tlsEx = stream.LastError;
				if (tlsEx != null)
					throw new AggregateException (ex, tlsEx);
				throw;
			}

			return stream;
		}
Example #3
0
        public static MonoNewTlsStream CreateServer(
            Stream innerStream, bool leaveOpen, MonoTlsProvider provider, MonoTlsSettings settings,
            SSCX.X509Certificate serverCertificate, bool clientCertificateRequired,
            SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
        {
            var stream = new MonoNewTlsStream(innerStream, leaveOpen, provider, settings);

            try {
                stream.AuthenticateAsServer(serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
            } catch (Exception ex) {
                var tlsEx = stream.LastError;
                if (tlsEx != null)
                {
                    throw new AggregateException(ex, tlsEx);
                }
                throw;
            }

            return(stream);
        }
Example #4
0
 public override void AuthenticateAsServer(X509Certificate serverCertificate)
 {
     Impl.AuthenticateAsServer(serverCertificate);
 }