pub struct Challenge {
pub type: String,
pub status: ChallengeStatus,
pub validated: Option<String>,
pub error: Option<ServerError>,
pub token: Option<String>,
/* private fields */
}Expand description
A challenge represents a means for the server to validate that an account has control over an identifier (domain).
A challenge can only be acquired through an Authorization.
Fields§
§type: StringThe type of challenge encoded in the object.
status: ChallengeStatusThe status of this challenge.
validated: Option<String>The time at which the server validated this challenge.
error: Option<ServerError>Error that occurred while the server was validating the challenge, if any.
token: Option<String>A random value that uniquely identifies the challenge.
Implementations§
Source§impl Challenge
impl Challenge
The key authorization is the token that the HTTP01 challenge should be serving for the ACME server to inspect.
The encoded key authorization is the token that the DNS01 challenge should be serving for the ACME server to inspect.
Sourcepub async fn validate(&self) -> Result<Challenge, Error>
pub async fn validate(&self) -> Result<Challenge, Error>
Initiate validation of the challenge by the ACME server.
Before calling this method, you should have set up your challenge token so it is available for the ACME server to check.
In most cases this will not complete immediately. You should always
call Challenge::wait_done after this operation to wait until the
ACME server has finished validation.
Sourcepub async fn poll(&self) -> Result<Challenge, Error>
pub async fn poll(&self) -> Result<Challenge, Error>
Update the challenge to match the current server state.
Most users should use Challenge::wait_done.
Sourcepub async fn wait_done(
self,
poll_interval: Duration,
attempts: usize,
) -> Result<Challenge, Error>
pub async fn wait_done( self, poll_interval: Duration, attempts: usize, ) -> Result<Challenge, Error>
Wait for the authorization to go into the AuthorizationStatus::Valid
or AuthorizationStatus::Invalid state.
Will complete immediately if the authorization is already in one of these states.
Specify the interval at which to poll the acme server, and how often to attempt polling before timing out. Polling should not happen faster than about every 5 seconds to avoid rate limits in the acme server.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Challenge
impl<'de> Deserialize<'de> for Challenge
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Challenge
impl !RefUnwindSafe for Challenge
impl Send for Challenge
impl Sync for Challenge
impl Unpin for Challenge
impl !UnwindSafe for Challenge
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)