Skip to content

Commit 81eaa0e

Browse files
committed
ACME: report challenge error for failed authorizations.
1 parent 14b1042 commit 81eaa0e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/acme.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,16 @@ where
479479
);
480480

481481
if result.status != AuthorizationStatus::Valid {
482-
return Err(NewCertificateError::AuthorizationStatus(result.status));
482+
if let Some(err) = result
483+
.challenges
484+
.iter()
485+
.find(|x| x.kind == challenge.kind)
486+
.and_then(|x| x.error.clone())
487+
{
488+
return Err(err.into());
489+
} else {
490+
return Err(NewCertificateError::AuthorizationStatus(result.status));
491+
}
483492
}
484493

485494
Ok(())

0 commit comments

Comments
 (0)