Esempio n. 1
0
        public async Task <List <AcmeDnsAuthorizationInfo> > GetAuthorizationsAsync()
        {
            var result = new List <AcmeDnsAuthorizationInfo>();

            foreach (var authorization in await OrderContext.Authorizations())
            {
                var challengeContext = await authorization.Dns();

                var dnsTxt = AcmeContext.AccountKey.DnsTxt(challengeContext.Token);

                var challenge = await challengeContext.Resource();

                var domain = await GetTopDomainAsync();

                var authInfo = new AcmeDnsAuthorizationInfo()
                {
                    Record     = $"{_challengeSubDomain}.{domain}",
                    RecordType = "TXT",
                    Value      = dnsTxt,
                    Status     = challenge.Status.ToString()
                };
                result.Add(authInfo);
            }
            return(result);
        }
Esempio n. 2
0
        public async Task AuthorizationAsync()
        {
            foreach (var authorization in await OrderContext.Authorizations())
            {
                var challengeContext = await authorization.Dns();

                await challengeContext.Validate();
            }
        }