コード例 #1
0
        public static void Auto(Target binding)
        {
            var auth = Authorize(binding);

            if (auth.Status == "valid")
            {
                var pfxFilename = GetCertificate(binding);

                if (Options.Test && !Options.Renew)
                {
                    Console.WriteLine($"\nDo you want to install the .pfx into the Certificate Store/ Central SSL Store? (Y/N) ");
                    if (!PromptYesNo())
                    {
                        return;
                    }
                }

                X509Store        store;
                X509Certificate2 certificate;
                if (!CentralSSL)
                {
                    InstallCertificate(binding, pfxFilename, out store, out certificate);
                    if (Options.Test && !Options.Renew)
                    {
                        Console.WriteLine($"\nDo you want to add/update the certificate to your server software? (Y/N) ");
                        if (!PromptYesNo())
                        {
                            return;
                        }

                        binding.Plugin.Install(binding, pfxFilename, store, certificate);
                    }
                    else if (!Options.Renew)
                    {
                        binding.Plugin.Install(binding, pfxFilename, store, certificate);
                    }
                }
                else if (!Options.Renew)
                {
                    //If it is using centralized SSL and renewing, it doesn't need to change the
                    //binding since just the certificate needs to be updated at the central ssl path
                    var iisplugin = new IISPlugin();
                    iisplugin.Install(binding);
                }

                if (Options.Test && !Options.Renew)
                {
                    Console.WriteLine($"\nDo you want to automatically renew this certificate in 60 days? This will add a task scheduler task. (Y/N) ");
                    if (!PromptYesNo())
                    {
                        return;
                    }
                }

                if (!Options.Renew)
                {
                    ScheduleRenewal(binding);
                }
            }
        }
コード例 #2
0
        public static void Auto(Target binding)
        {
            var auth = Authorize(binding);
            if (auth.Status == "valid")
            {
                var pfxFilename = GetCertificate(binding);

                if (Options.Test && !Options.Renew)
                {
                    Console.WriteLine($"\nDo you want to install the .pfx into the Certificate Store/ Central SSL Store? (Y/N) ");
                    if (!PromptYesNo())
                        return;
                }

                X509Store store;
                X509Certificate2 certificate;
                if (!CentralSSL)
                {
                    InstallCertificate(binding, pfxFilename, out store, out certificate);
                    if (Options.Test && !Options.Renew)
                    {
                        Console.WriteLine($"\nDo you want to add/update the certificate to your server software? (Y/N) ");
                        if (!PromptYesNo())
                            return;

                        binding.Plugin.Install(binding, pfxFilename, store, certificate);
                    }
                }
                else if (!Options.Renew)
                {
                    //If it is using centralized SSL and renewing, it doesn't need to change the
                    //binding since just the certificate needs to be updated at the central ssl path
                    var iisplugin = new IISPlugin();
                    iisplugin.Install(binding);
                }

                if (Options.Test && !Options.Renew)
                {
                    Console.WriteLine($"\nDo you want to automatically renew this certificate in 60 days? This will add a task scheduler task. (Y/N) ");
                    if (!PromptYesNo())
                        return;
                }

                if (!Options.Renew)
                    ScheduleRenewal(binding);
            }
        }