<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" ipr="trust200902" docName="draft-aaron-acme-ari-01" submissionType="IETF" category="std" xml:lang="en" consensus="true">

<front>
<title abbrev="ACME ARI">Automated Certificate Management Environment (ACME) Renewal Information (ARI) Extension</title><seriesInfo value="draft-aaron-acme-ari-01" stream="IETF" status="standard" name="Internet-Draft"/>
<author initials="A." surname="Gable"><organization>Internet Security Research Group</organization><address><postal><street/>
</postal><email>aaron@letsencrypt.org</email>
</address></author>
<date/>
<area>Security Area (sec)</area>
<workgroup>ACME Working Group</workgroup>
<keyword>Internet-Draft</keyword>

<abstract>
<t>This document specifies how an ACME server may provide hints to ACME clients as to when they should attempt to renew their certificates. This allows servers to mitigate load spikes, and ensures clients do not make false assumptions about appropriate certificate renewal periods.</t>
</abstract>

<note><name>Current Implementations</name>
<t>Draft note: this section will be removed by the editor before final publication.</t>
<t>Let's Encrypt's Staging environment (available at <xref target="lestaging"/>, source at <xref target="boulder"/>) implements this draft specification.</t>
</note>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t>Most ACME <xref target="RFC8555"/> clients today choose when to attempt to renew a certificate in one of three ways. They may be configured to renew at a specific interval (e.g. via <tt>cron</tt>); they may parse the issued certificate to determine its expiration date and renew a specific amount of time before then; or they may parse the issued certificate and renew when some percentage of its validity period has passed. The first two techniques create significant barriers against the issuing CA changing certificate lifetimes. All three techniques lead to load clustering for the issuing CA.</t>
<t>Being able to indicate to the client a period in which the issuing CA suggests renewal would allow both dynamic changes to the certificate validity period and proactive smearing of load. This document specifies a mechanism by which ACME servers may provide suggested renewal windows to ACME clients.</t>
</section>

<section anchor="conventions-and-definitions"><name>Conventions and Definitions</name>
<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 <xref target="RFC2119"/><xref target="RFC8174"/> when, and only when, they appear in all capitals, as shown here.</t>
</section>

<section anchor="extensions-to-the-acme-protocol-the-directory-resource"><name>Extensions to the ACME Protocol: The "directory" Resource</name>
<t>An ACME server which wishes to provide renewal information <bcp14>MUST</bcp14> include a new field, <tt>renewalInfo</tt>, in its directory object.</t>
<table>
<thead>
<tr>
<th>Field</th>
<th>URL in Value</th>
</tr>
</thead>

<tbody>
<tr>
<td>renewalInfo</td>
<td>Renewal info</td>
</tr>
</tbody>
</table>
<sourcecode type="json">HTTP/1.1 200 OK
Content-Type: application/json

{
  "newNonce": "https://example.com/acme/new-nonce",
  "newAccount": "https://example.com/acme/new-account",
  "newOrder": "https://example.com/acme/new-order",
  "newAuthz": "https://example.com/acme/new-authz",
  "revokeCert": "https://example.com/acme/revoke-cert",
  "keyChange": "https://example.com/acme/key-change",
  "renewalInfo": "https://example.com/acme/renewal-info",
  "meta": {
    "termsOfService": "https://example.com/acme/terms/2021-10-05",
    "website": "https://www.example.com/",
    "caaIdentities": ["example.com"],
    "externalAccountRequired": false
  }
}
</sourcecode>
</section>

<section anchor="extensions-to-the-acme-protocol-the-renewalinfo-resource"><name>Extensions to the ACME Protocol: The "renewalInfo" Resource</name>
<t>We define a new resource type, the "<tt>renewalInfo</tt>" resource, as part of the ACME protocol. To request the suggested renewal information for a certificate, the client sends a GET request to a path under the server's <tt>renewalInfo</tt> URL.</t>
<t>The full request URL is computed by concatenating the <tt>renewalInfo</tt> URL from the server's directory with the following case-insensitive hex-encoded (see <xref target="RFC4648"/>, Section <xref target="RFC4648"/>) elements, separated by forward slashes:</t>

<ul>
<li>the SHA-1 hash of the issuer's public key (often included in the certificate as the Authority Key Identifier, see <xref target="RFC5280"/>, Section <xref target="RFC5280"/>),</li>
<li>the SHA-1 hash of the issuer's Distinguished Name, see <xref target="RFC5280"/>, Section <xref target="RFC5280"/>, and</li>
<li>the certificate serial number.</li>
</ul>
<t>These are the same components that make up the <tt>CertID</tt> sequence of an <tt>OCSPRequest</tt> <xref target="RFC6960"/>, Section <xref target="RFC6960"/>, with the caveat that the hash algorithm is restricted to SHA-1, in line with <xref target="RFC5019"/>.</t>

<sourcecode type="text">GET https://example.com/acme/renewal-info
        /254581685026383D3B2D2CBECD6AD9B63DB36663
        /06FE0BABD8E6746EFCC4730285F7A9487ED1344F
        /BCDF4596B6BDC523
</sourcecode>
<t>The structure of an ACME <tt>renewalInfo</tt> resource is as follows:</t>
<t><tt>suggestedWindow</tt> (object, required): A JSON object with two keys, "<tt>start</tt>" and "<tt>end</tt>", whose values are timestamps, encoded in the format specified in <xref target="RFC3339"/>, which bound the window of time in which the CA recommends renewing the certificate.</t>

<sourcecode type="json">HTTP/1.1 200 OK
Content-Type: application/json
Retry-After: "21600"

{
  "suggestedWindow": {
    "start": "2021-01-03T00:00:00Z",
    "end": "2021-01-07T00:00:00Z"
  }
}
</sourcecode>
<t>The server <bcp14>SHOULD</bcp14> include a <tt>Retry-After</tt> header indicating the polling interval that the ACME server recommends. Conforming clients <bcp14>SHOULD</bcp14> query the <tt>renewalInfo</tt> URL again after the <tt>Retry-After</tt> period has passed, as the server may provide a different <tt>suggestedWindow</tt>.</t>
<t>Conforming clients <bcp14>MUST</bcp14> select a uniform random time within the suggested window to attempt to renew the certificate. If the selected time is in the past, the client <bcp14>SHOULD</bcp14> attempt renewal immediately. If the selected time is in the future, but before the next time that the client would wake up normally, the client <bcp14>MAY</bcp14> attempt renewal immediately. In all cases, renewal attempts are subject to the client's existing error backoff and retry intervals.</t>
<t>In particular, cron-based clients may find they need to increase their run frequency to check ARI more frequently. Those clients will need to store information about failures so that increasing their run frequency doesn't lead to retrying failures without proper backoff. Typical information stored should include: number of failures for a given order (defined by the set of names on the order), and time of the most recent failure.</t>
<t>If the client receives no response or a malformed response (e.g. an <tt>end</tt> timestamp which precedes the <tt>start</tt> timestamp), it <bcp14>SHOULD</bcp14> make its own determination of when to renew the certificate, and <bcp14>MAY</bcp14> retry the <tt>renewalInfo</tt> request with appropriate exponential backoff behavior.</t>
</section>

<section anchor="security-considerations"><name>Security Considerations</name>
<t>The extensions to the ACME protocol described in this document build upon the Security Considerations and threat model defined in <xref target="RFC8555"/>, Section <xref target="RFC8555"/>.</t>
<t>This document specifies that <tt>renewalInfo</tt> resources <bcp14>MUST</bcp14> be exposed and accessed via unauthenticated GET requests, a departure from RFC8555’s requirement that clients must send POST-as-GET requests to fetch resources from the server. This is because the information contained in <tt>renewalInfo</tt> resources is not considered confidential, and because allowing <tt>renewalInfo</tt> to be easily cached is advantageous to shed load from clients which do not respect the Retry-After header.</t>
</section>

<section anchor="iana-considerations"><name>IANA Considerations</name>
<t>Draft note: The following changes to IANA registries have not yet been made.</t>

<section anchor="new-registries"><name>New Registries</name>
<t>Within the "Automated Certificate Management Environment (ACME) Protocol" registry, IANA has created the new "ACME Renewal Info Object Fields" registry (Section 6.4).</t>
</section>

<section anchor="acme-resource-type"><name>ACME Resource Type</name>
<t>Within the "Automated Certificate Management Environment (ACME) Protocol" registry, the following entry has been added to the "ACME Resource Types" registry.</t>
<table>
<thead>
<tr>
<th>Field Name</th>
<th>Resource Type</th>
<th>Reference</th>
</tr>
</thead>

<tbody>
<tr>
<td>renewalInfo</td>
<td>Renewal Info object</td>
<td>This draft</td>
</tr>
</tbody>
</table></section>

<section anchor="acme-renewal-info-object-fields"><name>ACME Renewal Info Object Fields</name>
<t>The "ACME Renewal Info Object Fields" registry lists field names that are defined for use in ACME renewal info objects.</t>
<t>Template:</t>

<ul>
<li>Field name: The string to be used as a field name in the JSON object</li>
<li>Field type: The type of value to be provided, e.g., string, boolean, array of string</li>
<li>Reference: Where this field is defined</li>
</ul>
<t>Initial contents:</t>
<table>
<thead>
<tr>
<th>Field Name</th>
<th>Field type</th>
<th>Reference</th>
</tr>
</thead>

<tbody>
<tr>
<td>suggestedWindow</td>
<td>object</td>
<td>This draft</td>
</tr>
</tbody>
</table></section>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3339.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4648.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5019.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5280.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8555.xml"/>
</references>
<references><name>Informative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6960.xml"/>
<reference anchor="boulder" target="https://github.com/letsencrypt/boulder">
  <front>
    <title>Boulder</title>
    <author>
      <organization>Internet Security Research Group</organization>
    </author>
    <date year="2021"/>
  </front>
</reference>
<reference anchor="lestaging" target="https://acme-staging-v02.api.letsencrypt.org/directory">
  <front>
    <title>Let's Encrypt Staging Environment</title>
    <author>
      <organization>Internet Security Research Group</organization>
    </author>
    <date year="2021"/>
  </front>
</reference>
</references>

<section anchor="acknowledgments" numbered="false"><name>Acknowledgments</name>
<t>TODO acknowledge.</t>
</section>

</back>

</rfc>
