public Server(DomainManager domains) : base(domains, Environment.MachineName) { SaveTimer = new Timer(SaveProc); Lines = new LineSet(); DirectRemotes = new Dictionary<string, RemoteServer>(); Remotes = new Dictionary<string, RemoteServer>(); Settings = InitializeSettings(); LocalRehash(); Cache = Cache.Load(); if (Cache == null) { Cache = Cache.Create(); if (!Cache.Save()) { Console.WriteLine("Unable to save cache. Will not start until cache is writable for security."); Environment.Exit(1); return; } } Certificates = new CertificateManager(); string password = Settings.CertificatePassword; if (!Certificates.Load(Id, password) && !Certificates.Generate(Id, password)) { Console.WriteLine("Unable to generate certificate on non-Windows OS. There must be a single, valid X.509 certificate file named 'Certificate.{0}.*' in the current directory.", Id); Environment.Exit(1); return; } Initialize(); }
public Server(DomainManager domains) : base(domains, Environment.MachineName) { SaveTimer = new Timer(SaveProc); Lines = new LineSet(); DirectRemotes = new Dictionary <string, RemoteServer>(); Remotes = new Dictionary <string, RemoteServer>(); Settings = InitializeSettings(); LocalRehash(); Cache = Cache.Load(); if (Cache == null) { Cache = Cache.Create(); if (!Cache.Save()) { Console.WriteLine("Unable to save cache. Will not start until cache is writable for security."); Environment.Exit(1); return; } } Certificates = new CertificateManager(); string password = Settings.CertificatePassword; if (!Certificates.Load(Id, password) && !Certificates.Generate(Id, password)) { Console.WriteLine("Unable to generate certificate on non-Windows OS. There must be a single, valid X.509 certificate file named 'Certificate.{0}.*' in the current directory.", Id); Environment.Exit(1); return; } Initialize(); }