private static void SetWsusCertificate(string certPath, string certPass, IUpdateServer wServ) { if (wServ.IsConnectionSecureForApiRemoting) { try { var wsusConf = wServ.GetConfiguration(); wsusConf.SetSigningCertificate(certPath, certPass); wsusConf.Save(); Console.WriteLine("INFO: new Certificate imported"); } catch (Exception e) { Console.Error.WriteLine("ERROR: " + e.Message); } } else { Console.Error.WriteLine("ERROR: this operation is not possible with an unsafe connection"); } }