Skip to content

Commit f2a48d2

Browse files
committed
add sane retry intervals and timeouts
1 parent 6317169 commit f2a48d2

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

tls/autotls-client.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ while "broker" and "AutoTLS broker", which are used interchangeably, refer to th
5656

5757
## Parameters
5858

59-
| Parameter | Description | Reasonable Default |
60-
|--------------------------|------------------------------------------------------------------|--------------|
61-
| `max_dns_retries` | The maximum number of DNS queries that the node SHOULD make before giving up | ??? |
62-
| `max_dns_timeout` | The maximum number of seconds a node SHOULD wait for DNS records to be set | ??? |
63-
| `max_acme_poll_retries` | The maximum number of GET requests that the node SHOULD issue to ACME server before giving up | ??? |
64-
| `max_acme_timeout` | The maximum number of seconds a node SHOULD wait for an ACME resource status to change | ??? |
59+
| Parameter | Description | Reasonable Default |
60+
|--------------------------|---------------------------------------------------------------------------|---------------------|
61+
| `dns_poll_interval` | Time the node SHOULD wait between of DNS queries | 1 second |
62+
| `dns_timeout` | The maximum time a node SHOULD wait for DNS records to be set | 3 minutes |
63+
| `acme_poll_interval` | Time the node SHOULD wait between ACME GET requests | 1 second |
64+
| `acme_timeout` | The maximum time a node SHOULD wait for an ACME resource status to change | 3 minutes |
6565

6666
## Requesting challenge from ACME server
6767
1. The node starts a libp2p peer with public IPv4 and support for the [`identify`](https://github.com/libp2p/specs/blob/master/identify/README.md) protocol.
@@ -170,18 +170,26 @@ while "broker" and "AutoTLS broker", which are used interchangeably, refer to th
170170
For example, if the node has two public IPv4 addresses `1.1.1.1` and `8.8.8.8`, and the broker dialed it through `1.1.1.1`, then the node SHOULD query the `A 1-1-1-1.{b36peerid}.libp2p.direct`.
171171
For IPv6: Replace colons with dashes, handle leading/trailing colons as zeros (`2001:db8::1``2001-db8--1`, `2001:db8::``2001-db8--0`), and query `AAAA 2001-db8--1.{b36peerid}.libp2p.direct`.
172172

173+
<<<<<<< Updated upstream
173174
**Note:** The node SHOULD NOT send more than `max_dns_retries` DNS requests.
174175
After `max_dns_timeout`, the communication is considered failed.
175176
What to do after `max_dns_timeout` has passed is left as an implementation decision.
177+
=======
178+
**Note:** The node SHOULD NOT poll DNS for longer than `dns_timeout`. After `dns_timeout`, the communication is considered failed. What to do after `dns_timeout` has passed is left as an implementation decision.
179+
>>>>>>> Stashed changes
176180
177181
2. Node notifies the ACME server about challenge completion so that the ACME server can lookup the DNS resource records that the AutoTLS broker has set. The notification is done in the form of a POST request to `chalUrl` with an empty HTTP body (`{}`).
178182
1. Node sends an empty signed JSON payload (`{}`) to the ACME server using the `kid` obtained from the initial ACME registration and gets the response from the server (`completedResponse`).
179183
2. Node extracts `url` field from `completedResponse`'s JSON body. The extracted URL is named `checkUrl` in this document.
180184
3. The node polls the ACME server by sending a GET HTTP request to `checkUrl` with an empty body, and sign using the `kid` of the registered account. The node MUST poll the ACME server until it receives a response with `status: valid` or `status: invalid` field, meaning that the challenge checking was successful or not, respectively.
181185

186+
<<<<<<< Updated upstream
182187
**Note:** The node SHOULD NOT send more than `max_acme_poll_retries` poll requests to the ACME server.
183188
After `max_acme_timeout`, the communication has failed.
184189
What to do after `max_acme_timeout` has passed is left as an implementation decision.
190+
=======
191+
**Note:** The node SHOULD NOT send more than one request every `acme_interval` to the ACME server. The node SHOULD use exponential backoff to increase time between retries. After `acme_timeout`, the communication has failed. What to do after `acme_timeout` has passed is left as an implementation decision.
192+
>>>>>>> Stashed changes
185193
186194

187195

@@ -192,9 +200,13 @@ What to do after `max_acme_timeout` has passed is left as an implementation deci
192200
3. Send a `kid` signed POST request to `finalizeUrl` with JSON HTTP body of `{"csr": b64CSR}`.
193201
2. Node MUST poll ACME server by sending GET requests to `orderUrl` until the ACME server's response contains a `status` field with a value different than `processing`.
194202

203+
<<<<<<< Updated upstream
195204
**Note:** The node SHOULD NOT send more than `max_acme_poll_retries` poll requests to the ACME server.
196205
After `max_acme_timeout`, the communication has failed.
197206
What to do after `max_acme_timeout` has passed is left as an implementation decision.
207+
=======
208+
**Note:** The node SHOULD NOT send more than one request every `acme_interval` to the ACME server. The node SHOULD use exponential backoff to increase time between retries. After `acme_timeout`, the communication has failed. What to do after `acme_timeout` has passed is left as an implementation decision.
209+
>>>>>>> Stashed changes
198210
199211
3. Node downloads finalized certificate by sending a GET request to `certDownloadUrl`.
200212
`certDownloadUrl` is found in the `certificate` field of the JSON HTTP body of a response to a GET request to `orderUrl`.

0 commit comments

Comments
 (0)