Ejemplo n.º 1
0
        public async Task AnswerChallengeAsync(
            string challengeDetailsUrl)
        {
            ACMESharpChallenge challenge = await _client.AnswerChallengeAsync(challengeDetailsUrl);

            object error = challenge.Error;

            if (error != null)
            {
                throw new ACMEClientException($"challenge error {error}");
            }
        }
Ejemplo n.º 2
0
        public ChallengeDetails(ACMESharpChallenge acmeSharpChallenge,
                                IACMESharpChallengeValidationDetails acmeSharpChallengeValidationDetails, long expires)
        {
            if (Enum.TryParse(acmeSharpChallenge.Status, out ChallengeStatus status))
            {
                // testing server may pass "testing"
                Status = status;
            }

            Error   = acmeSharpChallenge.Error;
            Url     = acmeSharpChallenge.Url;
            Expires = expires;

            ChallengeType = ChallengeTypeMethods.ParseFromString(acmeSharpChallengeValidationDetails.ChallengeType);
            switch (acmeSharpChallengeValidationDetails)
            {
            case ACMESharpHttp01ChallengeValidationDetails acmeSharpHttpChallengeDetail:
                HttpResourceUrl         = acmeSharpHttpChallengeDetail.HttpResourceUrl;
                HttpResourcePath        = acmeSharpHttpChallengeDetail.HttpResourcePath;
                HttpResourceContentType = acmeSharpHttpChallengeDetail.HttpResourceContentType;
                HttpResourceValue       = acmeSharpHttpChallengeDetail.HttpResourceValue;
                break;
            }
        }