Пример #1
0
        private async Task <bool> AuthorizeForDomain(string domain)
        {
            var authorization = await client.NewDnsAuthorizationAsync(domain);

            var challenge = await challengeProvider.AcceptChallengeAsync(domain, options.IISWebSite, authorization);

            if (challenge == null)
            {
                return(false);
            }

            System.Console.WriteLine(challenge.Instructions);
            if (!options.AcceptInstructions)
            {
                System.Console.WriteLine("Press ENTER to continue");
                System.Console.ReadLine();
            }
            else
            {
                System.Console.WriteLine("Automatically accepting instructions.");
            }
            var challengeResult = await challenge.Complete();

            return(challengeResult?.Status == "valid");
        }
Пример #2
0
        private async Task <bool> AuthorizeForDomain(string domain)
        {
            var authorization = await client.NewDnsAuthorizationAsync(domain);

            var challenge = await challengeProvider.AcceptChallengeAsync(domain, options.IISWebSite, authorization);

            if (challenge == null)
            {
                return(false);
            }

            System.Console.WriteLine(challenge.Instructions);
            System.Console.WriteLine("Press ENTER to continue");
            System.Console.ReadLine();
            var challengeResult = await challenge.Complete();

            return("valid".Equals(challengeResult?.Status, StringComparison.OrdinalIgnoreCase));
        }