Commit Graph

81 Commits

Author SHA1 Message Date
dvdsk c9a7b9da52 cargo fmt 2023-04-23 20:16:42 +02:00
dvdsk 9f9c6e48fe add comment to prevent regressing PR #17 2023-04-23 20:16:42 +02:00
David Kleingeld 3257747d6b emit Problem::check error even if no url found
Lets encrypt can return a clear error when creating a new order without returning an `order_url`. 

A missing `order_url` however triggers an early return with error message `no order URL found`. The error from lets encrypt is then never shown to the crate user.

Swapping the `state` and `url` field instantiation in `new_order`  is enough to let `Problem::check` emit the lets encrypt error.

### Example case
Requesting a certificate for *example.org*:
Original output:
```
missing data: no order URL found
```

New:
```
API error: Error creating new order :: Cannot issue for "example.org": The ACME server refuses to issue a certificate for this domain name, because it is forbidden by policy (urn:ietf:params:acme:error:rejectedIdentifier)
```
2023-04-23 16:07:10 +02:00
David Kleingeld 1a9ce194b7 Annotate Api::Problem error with thiserror::transparent
Error variant `Api::Problem` prints "API error: {problem}" however the Problem struct has display impl that starts by printing "API error". Together this results in "API error: API error" followed by the details.

This fixes that by annotating `Api::Problem` with `thiserror`'s `transparent` attribute which forwards the display impl to the underlying types display impl.
2023-04-23 15:18:14 +02:00
Dirkjan Ochtman 0cc77ff2ca Postpone certificate retrieval until order is valid 2023-03-15 19:01:15 +01:00
Dirkjan Ochtman a2d4129201 Maintain OrderState within Order type 2023-03-15 19:01:15 +01:00
Dirkjan Ochtman 77e435ca01 Apply clippy suggestions for 1.67 2023-01-30 14:17:37 +01:00
Dirkjan Ochtman a438e48f02 Bump base64 dependency to 0.21 2023-01-09 12:57:53 +01:00
Dirkjan Ochtman 60ed0983a7 Rename to_bytes() to digest() 2022-11-15 10:11:13 +01:00
Dirkjan Ochtman 8c0a179cc9 Document challenge types in specific methods 2022-11-15 10:10:52 +01:00
Dirkjan Ochtman b87f572719 Create constructor for KeyAuthorization 2022-11-15 10:03:10 +01:00
Dirkjan Ochtman f34971b3e8 Move KeyAuthorization into crate root 2022-11-15 10:00:57 +01:00
Sajjad Pourali 1f42c1e5a2 Allow direct access to SHA-256 digest of KeyAuthorization
This is used directly for the TLS-ALPN-01 challenge type.
2022-11-15 09:54:12 +01:00
Dirkjan Ochtman 37223c1a62 Apply clippy suggestions 2022-08-12 18:38:08 +02:00
Dirkjan Ochtman b7dd9c4dc0 Add API documentation 2022-05-12 21:47:01 +02:00
Dirkjan Ochtman 1cf7c81f6b Make LetsEncrypt::url() const 2022-05-12 21:47:01 +02:00
Dirkjan Ochtman 82daaac525 acme: simplify account serialization handling 2022-05-12 10:00:26 +02:00
Dirkjan Ochtman 8082166924 acme: reduce unnecessary cloning 2022-05-12 10:00:26 +02:00
Dirkjan Ochtman 5be34c546c acme: inline nonce handling 2022-05-12 10:00:26 +02:00
Dirkjan Ochtman 40a561ffb5 acme: switch from reqwest to hyper 2022-05-12 10:00:26 +02:00
Dirkjan Ochtman 3e64360c59 acme: move Problem extraction into associated function 2022-05-12 10:00:26 +02:00
Dirkjan Ochtman 827c3baa6a acme: move post() implementation into Client 2022-05-12 10:00:26 +02:00
Dirkjan Ochtman 8604aa483e acme: define trait to abstract over signer types 2022-05-12 10:00:26 +02:00
Dirkjan Ochtman bed1565783 acme: move Client construction into associated function 2022-05-12 10:00:26 +02:00
Dirkjan Ochtman e4ef9955a3 acme: align Authorization type with RFC structure 2022-04-22 09:44:54 +02:00
Dirkjan Ochtman 8433cd143f rust: apply clippy suggestions from 1.60 2022-04-07 21:16:37 +02:00
Nicholas Rempel faa660a6d1 acme: Make acme logs more verbose 2022-02-15 12:21:30 -08:00
Dirkjan Ochtman 8b8ade0cb3 acme: move more logic into library 2022-02-09 10:11:28 -08:00
Dirkjan Ochtman a04cf7c618 acme: clean up unnecessary lint suppression 2022-02-09 10:11:28 -08:00
Dirkjan Ochtman d4b617cce7 epoxide: retry ACME provisioning 2022-02-08 12:50:40 -08:00
Dirkjan Ochtman 0060778f15 rust: initial implementation of an ACME client 2022-01-28 11:37:57 +01:00