Пример #1
0
        private TlsServer InitializeTlsServer()
        {
            TlsServer remotingServer;

            remotingServer = new TlsServer();
            remotingServer.CertificateFile = "Internal.cer";
            remotingServer.ConfigurationString = "Port=8500";
            remotingServer.IgnoreInvalidCredentials = true;
            remotingServer.PayloadAware = true;
            remotingServer.PersistSettings = true;
            remotingServer.SettingsCategory = "RemotingServer";
            remotingServer.TrustedCertificatesPath = $"Certs{Path.DirectorySeparatorChar}Remotes";
            remotingServer.Initialize();

            remotingServer.RemoteCertificateValidationCallback = (o, certificate, chain, errors) => true;

            return remotingServer;
        }