idnits 2.17.1 draft-ietf-acme-acme-13.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There are 3 instances of too long lines in the document, the longest one being 15 characters in excess of 72. ** The abstract seems to contain references ([1]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 877 has weird spacing: '...Account newA...' -- The exact meaning of the all-uppercase expression 'NOT REQUIRED' is not defined in RFC 2119. If it is intended as a requirements expression, it should be rewritten using one of the combinations defined in RFC 2119; otherwise it should not be all-uppercase. -- The document date (July 17, 2018) is 2110 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '1' on line 3863 == Missing Reference: 'Order' is mentioned on line 373, but not defined == Missing Reference: 'Responses' is mentioned on line 377, but not defined == Missing Reference: 'CSR' is mentioned on line 382, but not defined == Missing Reference: 'A-Z' is mentioned on line 627, but not defined == Missing Reference: '0-9' is mentioned on line 627, but not defined -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS180-4' -- Possible downref: Non-RFC (?) normative reference: ref. 'JSS15' ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Downref: Normative reference to an Informational RFC: RFC 2985 ** Downref: Normative reference to an Informational RFC: RFC 2986 ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) ** Obsolete normative reference: RFC 5988 (Obsoleted by RFC 8288) ** Obsolete normative reference: RFC 6844 (Obsoleted by RFC 8659) ** Obsolete normative reference: RFC 7159 (Obsoleted by RFC 8259) ** Obsolete normative reference: RFC 7231 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 7807 (Obsoleted by RFC 9457) == Outdated reference: A later version (-10) exists of draft-ietf-acme-caa-05 == Outdated reference: A later version (-08) exists of draft-ietf-acme-ip-02 -- Obsolete informational reference (is this intentional?): RFC 5785 (Obsoleted by RFC 8615) -- Obsolete informational reference (is this intentional?): RFC 7525 (Obsoleted by RFC 9325) Summary: 11 errors (**), 0 flaws (~~), 9 warnings (==), 8 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 ACME Working Group R. Barnes 3 Internet-Draft Cisco 4 Intended status: Standards Track J. Hoffman-Andrews 5 Expires: January 18, 2019 EFF 6 D. McCarney 7 Let's Encrypt 8 J. Kasten 9 University of Michigan 10 July 17, 2018 12 Automatic Certificate Management Environment (ACME) 13 draft-ietf-acme-acme-13 15 Abstract 17 Certificates in PKI using X.509 (PKIX) are used for a number of 18 purposes, the most significant of which is the authentication of 19 domain names. Thus, certificate authorities in the Web PKI are 20 trusted to verify that an applicant for a certificate legitimately 21 represents the domain name(s) in the certificate. Today, this 22 verification is done through a collection of ad hoc mechanisms. This 23 document describes a protocol that a certification authority (CA) and 24 an applicant can use to automate the process of verification and 25 certificate issuance. The protocol also provides facilities for 26 other certificate management functions, such as certificate 27 revocation. 29 RFC EDITOR: PLEASE REMOVE THE FOLLOWING PARAGRAPH: The source for 30 this draft is maintained in GitHub. Suggested changes should be 31 submitted as pull requests at https://github.com/ietf-wg-acme/acme 32 [1]. Instructions are on that page as well. Editorial changes can 33 be managed in GitHub, but any substantive change should be discussed 34 on the ACME mailing list (acme@ietf.org). 36 Status of This Memo 38 This Internet-Draft is submitted in full conformance with the 39 provisions of BCP 78 and BCP 79. 41 Internet-Drafts are working documents of the Internet Engineering 42 Task Force (IETF). Note that other groups may also distribute 43 working documents as Internet-Drafts. The list of current Internet- 44 Drafts is at https://datatracker.ietf.org/drafts/current/. 46 Internet-Drafts are draft documents valid for a maximum of six months 47 and may be updated, replaced, or obsoleted by other documents at any 48 time. It is inappropriate to use Internet-Drafts as reference 49 material or to cite them other than as "work in progress." 51 This Internet-Draft will expire on January 18, 2019. 53 Copyright Notice 55 Copyright (c) 2018 IETF Trust and the persons identified as the 56 document authors. All rights reserved. 58 This document is subject to BCP 78 and the IETF Trust's Legal 59 Provisions Relating to IETF Documents 60 (https://trustee.ietf.org/license-info) in effect on the date of 61 publication of this document. Please review these documents 62 carefully, as they describe your rights and restrictions with respect 63 to this document. Code Components extracted from this document must 64 include Simplified BSD License text as described in Section 4.e of 65 the Trust Legal Provisions and are provided without warranty as 66 described in the Simplified BSD License. 68 Table of Contents 70 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 71 2. Deployment Model and Operator Experience . . . . . . . . . . 5 72 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 7 73 4. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 7 74 5. Character Encoding . . . . . . . . . . . . . . . . . . . . . 10 75 6. Message Transport . . . . . . . . . . . . . . . . . . . . . . 10 76 6.1. HTTPS Requests . . . . . . . . . . . . . . . . . . . . . 10 77 6.2. Request Authentication . . . . . . . . . . . . . . . . . 11 78 6.3. Request URL Integrity . . . . . . . . . . . . . . . . . . 12 79 6.3.1. "url" (URL) JWS Header Parameter . . . . . . . . . . 13 80 6.4. Replay protection . . . . . . . . . . . . . . . . . . . . 13 81 6.4.1. Replay-Nonce . . . . . . . . . . . . . . . . . . . . 14 82 6.4.2. "nonce" (Nonce) JWS Header Parameter . . . . . . . . 14 83 6.5. Rate Limits . . . . . . . . . . . . . . . . . . . . . . . 14 84 6.6. Errors . . . . . . . . . . . . . . . . . . . . . . . . . 15 85 6.6.1. Subproblems . . . . . . . . . . . . . . . . . . . . . 17 86 7. Certificate Management . . . . . . . . . . . . . . . . . . . 18 87 7.1. Resources . . . . . . . . . . . . . . . . . . . . . . . . 18 88 7.1.1. Directory . . . . . . . . . . . . . . . . . . . . . . 20 89 7.1.2. Account Objects . . . . . . . . . . . . . . . . . . . 22 90 7.1.3. Order Objects . . . . . . . . . . . . . . . . . . . . 23 91 7.1.4. Authorization Objects . . . . . . . . . . . . . . . . 26 92 7.1.5. Challenge Objects . . . . . . . . . . . . . . . . . . 28 93 7.1.6. Status Changes . . . . . . . . . . . . . . . . . . . 28 94 7.2. Getting a Nonce . . . . . . . . . . . . . . . . . . . . . 30 95 7.3. Account Creation . . . . . . . . . . . . . . . . . . . . 31 96 7.3.1. Finding an Account URL Given a Key . . . . . . . . . 33 97 7.3.2. Account Update . . . . . . . . . . . . . . . . . . . 34 98 7.3.3. Account Information . . . . . . . . . . . . . . . . . 34 99 7.3.4. Changes of Terms of Service . . . . . . . . . . . . . 35 100 7.3.5. External Account Binding . . . . . . . . . . . . . . 35 101 7.3.6. Account Key Roll-over . . . . . . . . . . . . . . . . 37 102 7.3.7. Account Deactivation . . . . . . . . . . . . . . . . 40 103 7.4. Applying for Certificate Issuance . . . . . . . . . . . . 41 104 7.4.1. Pre-Authorization . . . . . . . . . . . . . . . . . . 46 105 7.4.2. Downloading the Certificate . . . . . . . . . . . . . 48 106 7.5. Identifier Authorization . . . . . . . . . . . . . . . . 49 107 7.5.1. Responding to Challenges . . . . . . . . . . . . . . 50 108 7.5.2. Deactivating an Authorization . . . . . . . . . . . . 52 109 7.6. Certificate Revocation . . . . . . . . . . . . . . . . . 53 110 8. Identifier Validation Challenges . . . . . . . . . . . . . . 55 111 8.1. Key Authorizations . . . . . . . . . . . . . . . . . . . 57 112 8.2. Retrying Challenges . . . . . . . . . . . . . . . . . . . 57 113 8.3. HTTP Challenge . . . . . . . . . . . . . . . . . . . . . 58 114 8.4. DNS Challenge . . . . . . . . . . . . . . . . . . . . . . 60 115 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 62 116 9.1. MIME Type: application/pem-certificate-chain . . . . . . 62 117 9.2. Well-Known URI for the HTTP Challenge . . . . . . . . . . 63 118 9.3. Replay-Nonce HTTP Header . . . . . . . . . . . . . . . . 63 119 9.4. "url" JWS Header Parameter . . . . . . . . . . . . . . . 63 120 9.5. "nonce" JWS Header Parameter . . . . . . . . . . . . . . 64 121 9.6. URN Sub-namespace for ACME (urn:ietf:params:acme) . . . . 64 122 9.7. New Registries . . . . . . . . . . . . . . . . . . . . . 64 123 9.7.1. Fields in Account Objects . . . . . . . . . . . . . . 65 124 9.7.2. Fields in Order Objects . . . . . . . . . . . . . . . 66 125 9.7.3. Fields in Authorization Objects . . . . . . . . . . . 67 126 9.7.4. Error Types . . . . . . . . . . . . . . . . . . . . . 68 127 9.7.5. Resource Types . . . . . . . . . . . . . . . . . . . 68 128 9.7.6. Fields in the "meta" Object within a Directory Object 69 129 9.7.7. Identifier Types . . . . . . . . . . . . . . . . . . 70 130 9.7.8. Validation Methods . . . . . . . . . . . . . . . . . 70 131 10. Security Considerations . . . . . . . . . . . . . . . . . . . 72 132 10.1. Threat Model . . . . . . . . . . . . . . . . . . . . . . 72 133 10.2. Integrity of Authorizations . . . . . . . . . . . . . . 73 134 10.3. Denial-of-Service Considerations . . . . . . . . . . . . 77 135 10.4. Server-Side Request Forgery . . . . . . . . . . . . . . 77 136 10.5. CA Policy Considerations . . . . . . . . . . . . . . . . 78 137 11. Operational Considerations . . . . . . . . . . . . . . . . . 79 138 11.1. Key Selection . . . . . . . . . . . . . . . . . . . . . 79 139 11.2. DNS security . . . . . . . . . . . . . . . . . . . . . . 80 140 11.3. Token Entropy . . . . . . . . . . . . . . . . . . . . . 80 141 11.4. Malformed Certificate Chains . . . . . . . . . . . . . . 81 142 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 81 143 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 82 144 13.1. Normative References . . . . . . . . . . . . . . . . . . 82 145 13.2. Informative References . . . . . . . . . . . . . . . . . 85 146 13.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 86 147 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 86 149 1. Introduction 151 Certificates [RFC5280] in the Web PKI are most commonly used to 152 authenticate domain names. Thus, certificate authorities in the Web 153 PKI are trusted to verify that an applicant for a certificate 154 legitimately represents the domain name(s) in the certificate. 156 Different types of certificates reflect different kinds of CA 157 verification of information about the certificate subject. "Domain 158 Validation" (DV) certificates are by far the most common type. The 159 only validation the CA is required to perform in the DV issuance 160 process is to verify that the requester has effective control of the 161 domain. The CA is not required to attempt to verify the requester's 162 real-world identity. (This is as opposed to "Organization 163 Validation" (OV) and "Extended Validation" (EV) certificates, where 164 the process is intended to also verify the real-world identity of the 165 requester.) 167 Existing Web PKI certificate authorities tend to use a set of ad hoc 168 protocols for certificate issuance and identity verification. In the 169 case of DV certificates, a typical user experience is something like: 171 o Generate a PKCS#10 [RFC2986] Certificate Signing Request (CSR). 173 o Cut-and-paste the CSR into a CA web page. 175 o Prove ownership of the domain by one of the following methods: 177 * Put a CA-provided challenge at a specific place on the web 178 server. 180 * Put a CA-provided challenge in a DNS record corresponding to 181 the target domain. 183 * Receive a CA-provided challenge at a (hopefully) administrator- 184 controlled email address corresponding to the domain and then 185 respond to it on the CA's web page. 187 o Download the issued certificate and install it on their Web 188 Server. 190 With the exception of the CSR itself and the certificates that are 191 issued, these are all completely ad hoc procedures and are 192 accomplished by getting the human user to follow interactive natural- 193 language instructions from the CA rather than by machine-implemented 194 published protocols. In many cases, the instructions are difficult 195 to follow and cause significant confusion. Informal usability tests 196 by the authors indicate that webmasters often need 1-3 hours to 197 obtain and install a certificate for a domain. Even in the best 198 case, the lack of published, standardized mechanisms presents an 199 obstacle to the wide deployment of HTTPS and other PKIX-dependent 200 systems because it inhibits mechanization of tasks related to 201 certificate issuance, deployment, and revocation. 203 This document describes an extensible framework for automating the 204 issuance and domain validation procedure, thereby allowing servers 205 and infrastructural software to obtain certificates without user 206 interaction. Use of this protocol should radically simplify the 207 deployment of HTTPS and the practicality of PKIX authentication for 208 other protocols based on Transport Layer Security (TLS) [RFC5246]. 210 It should be noted that while the focus of this document is on 211 validating domain names for purposes of issuing certificates in the 212 Web PKI, ACME supports extensions for uses with other identifiers in 213 other PKI contexts. For example, as of this writing, there is 214 ongoing work to use ACME for issuance of WebPKI certificates 215 attesting to IP addresses [I-D.ietf-acme-ip] and STIR certificates 216 attesting to telephone numbers [I-D.ietf-acme-telephone]. 218 ACME can also be used to automate some aspects of certificate 219 management even where non-automated processes are still needed. For 220 example, the external account binding feature (see Section 7.3.5) can 221 allow an ACME account to use authorizations that have been granted to 222 an external, non-ACME account. This allows ACME to address issuance 223 scenarios that cannot yet be fully automated, such as the issuance of 224 Extended Validation certificates. 226 2. Deployment Model and Operator Experience 228 The guiding use case for ACME is obtaining certificates for websites 229 (HTTPS [RFC2818]). In this case, the user's web server is intended 230 to speak for one or more domains, and the process of certificate 231 issuance is intended to verify that this web server actually speaks 232 for the domain(s). 234 DV certificate validation commonly checks claims about properties 235 related to control of a domain name - properties that can be observed 236 by the certificate issuer in an interactive process that can be 237 conducted purely online. That means that under typical 238 circumstances, all steps in the request, verification, and issuance 239 process can be represented and performed by Internet protocols with 240 no out-of-band human intervention. 242 Prior to ACME, when deploying an HTTPS server, a server operator 243 typically gets a prompt to generate a self-signed certificate. If 244 the operator were instead deploying an HTTPS server using ACME, the 245 experience would be something like this: 247 o The operator's ACME client prompts the operator for the intended 248 domain name(s) that the web server is to stand for. 250 o The ACME client presents the operator with a list of CAs from 251 which it could get a certificate. (This list will change over 252 time based on the capabilities of CAs and updates to ACME 253 configuration.) The ACME client might prompt the operator for 254 payment information at this point. 256 o The operator selects a CA. 258 o In the background, the ACME client contacts the CA and requests 259 that it issue a certificate for the intended domain name(s). 261 o The CA verifies that the client controls the requested domain 262 name(s) by having the ACME client perform some action(s) that can 263 only be done with control of the domain name(s). For example, the 264 CA might require a client requesting example.com to provision DNS 265 record under example.com or an HTTP resource under 266 http://example.com. 268 o Once the CA is satisfied, it issues the certificate and the ACME 269 client automatically downloads and installs it, potentially 270 notifying the operator via email, SMS, etc. 272 o The ACME client periodically contacts the CA to get updated 273 certificates, stapled OCSP responses, or whatever else would be 274 required to keep the web server functional and its credentials up- 275 to-date. 277 In this way, it would be nearly as easy to deploy with a CA-issued 278 certificate as with a self-signed certificate. Furthermore, the 279 maintenance of that CA-issued certificate would require minimal 280 manual intervention. Such close integration of ACME with HTTPS 281 servers allows the immediate and automated deployment of certificates 282 as they are issued, sparing the human administrator from much of the 283 time-consuming work described in the previous section. 285 3. Terminology 287 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 288 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 289 "OPTIONAL" in this document are to be interpreted as described in BCP 290 14 [RFC2119] [RFC8174] when, and only when, they appear in all 291 capitals, as shown here. 293 The two main roles in ACME are "client" and "server". The ACME 294 client uses the protocol to request certificate management actions, 295 such as issuance or revocation. An ACME client may run on a web 296 server, mail server, or some other server system which requires valid 297 TLS certificates. Or, it may run on a separate server that does not 298 consume the certificate, but is authorized to respond to a CA- 299 provided challenge. The ACME server runs at a certification 300 authority, and responds to client requests, performing the requested 301 actions if the client is authorized. 303 An ACME client authenticates to the server by means of an "account 304 key pair". The client uses the private key of this key pair to sign 305 all messages sent to the server. The server uses the public key to 306 verify the authenticity and integrity of messages from the client. 308 4. Protocol Overview 310 ACME allows a client to request certificate management actions using 311 a set of JavaScript Object Notation (JSON) messages carried over 312 HTTPS. Issuance using ACME resembles a traditional CA's issuance 313 process, in which a user creates an account, requests a certificate, 314 and proves control of the domain(s) in that certificate in order for 315 the CA to sign the requested certificate. 317 The first phase of ACME is for the client to request an account with 318 the ACME server. The client generates an asymmetric key pair and 319 requests a new account, optionally providing contact information, 320 agreeing to terms of service, and/or associating the account with an 321 existing account in another system. The creation request is signed 322 with the generated private key to prove that the client controls it. 324 Client Server 326 [Contact Information] 327 [ToS Agreement] 328 [Additional Data] 329 Signature -------> 330 Account URL 331 <------- Account Object 333 [] Information covered by request signatures 335 Account Creation 337 Once an account is registered, there are four major steps the client 338 needs to take to get a certificate: 340 1. Submit an order for a certificate to be issued 342 2. Prove control of any identifiers requested in the certificate 344 3. Finalize the order by submitting a CSR 346 4. Await issuance and download the issued certificate 348 The client's order for a certificate describes the desired 349 identifiers plus a few additional fields that capture semantics that 350 are not supported in the CSR format. If the server is willing to 351 consider issuing such a certificate, it responds with a list of 352 requirements that the client must satisfy before the certificate will 353 be issued. 355 For example, in most cases, the server will require the client to 356 demonstrate that it controls the identifiers in the requested 357 certificate. Because there are many different ways to validate 358 possession of different types of identifiers, the server will choose 359 from an extensible set of challenges that are appropriate for the 360 identifier being claimed. The client responds with a set of 361 responses that tell the server which challenges the client has 362 completed. The server then validates that the client has completed 363 the challenges. 365 Once the validation process is complete and the server is satisfied 366 that the client has met its requirements, the client finalizes the 367 order by submitting a PKCS#10 Certificate Signing Request (CSR). The 368 server will issue the requested certificate and make it available to 369 the client. 371 Client Server 373 [Order] 374 Signature -------> 375 <------- Required Authorizations 377 [Responses] 378 Signature -------> 380 <~~~~~~~~Validation~~~~~~~~> 382 [CSR] 383 Signature -------> 384 <------- Acknowledgement 386 <~~~~~~Await issuance~~~~~~> 388 GET request -------> 389 <------- Certificate 391 [] Information covered by request signatures 393 Certificate Issuance 395 To revoke a certificate, the client sends a signed revocation request 396 indicating the certificate to be revoked: 398 Client Server 400 [Revocation request] 401 Signature --------> 403 <-------- Result 405 [] Information covered by request signatures 407 Certificate Revocation 409 Note that while ACME is defined with enough flexibility to handle 410 different types of identifiers in principle, the primary use case 411 addressed by this document is the case where domain names are used as 412 identifiers. For example, all of the identifier validation 413 challenges described in Section 8 below address validation of domain 414 names. The use of ACME for other identifiers will require further 415 specification in order to describe how these identifiers are encoded 416 in the protocol and what types of validation challenges the server 417 might require. 419 5. Character Encoding 421 All requests and responses sent via HTTP by ACME clients, ACME 422 servers, and validation servers as well as any inputs for digest 423 computations MUST be encoded using the UTF-8 [RFC3629] character set. 425 6. Message Transport 427 Communications between an ACME client and an ACME server are done 428 over HTTPS, using JSON Web Signature (JWS) [RFC7515] to provide some 429 additional security properties for messages sent from the client to 430 the server. HTTPS provides server authentication and 431 confidentiality. With some ACME-specific extensions, JWS provides 432 authentication of the client's request payloads, anti-replay 433 protection, and integrity for the HTTPS request URL. 435 6.1. HTTPS Requests 437 Each ACME function is accomplished by the client sending a sequence 438 of HTTPS requests to the server, carrying JSON messages 439 [RFC2818][RFC7159]. Use of HTTPS is REQUIRED. Each subsection of 440 Section 7 below describes the message formats used by the function 441 and the order in which messages are sent. 443 In most HTTPS transactions used by ACME, the ACME client is the HTTPS 444 client and the ACME server is the HTTPS server. The ACME server acts 445 as an HTTP and HTTPS client when validating challenges via HTTP. 447 ACME servers SHOULD follow the recommendations of [RFC7525] when 448 configuring their TLS implementations. ACME servers that support TLS 449 1.3 MAY allow clients to send early data (0-RTT). This is safe 450 because the ACME protocol itself includes anti-replay protections 451 (see Section 6.4). 453 ACME clients MUST send a User-Agent header, in accordance with 454 [RFC7231]. This header SHOULD include the name and version of the 455 ACME software in addition to the name and version of the underlying 456 HTTP client software. 458 ACME clients SHOULD send an Accept-Language header in accordance with 459 [RFC7231] to enable localization of error messages. 461 ACME servers that are intended to be generally accessible need to use 462 Cross-Origin Resource Sharing (CORS) in order to be accessible from 463 browser-based clients [W3C.CR-cors-20130129]. Such servers SHOULD 464 set the Access-Control-Allow-Origin header field to the value "*". 466 Binary fields in the JSON objects used by ACME are encoded using 467 base64url encoding described in [RFC4648] Section 5, according to the 468 profile specified in JSON Web Signature [RFC7515] Section 2. This 469 encoding uses a URL safe character set. Trailing '=' characters MUST 470 be stripped. Encoded values that include trailing '=' characters 471 MUST be rejected as improperly encoded. 473 6.2. Request Authentication 475 All ACME requests with a non-empty body MUST encapsulate their 476 payload in a JSON Web Signature (JWS) [RFC7515] object, signed using 477 the account's private key unless otherwise specified. The server 478 MUST verify the JWS before processing the request. Encapsulating 479 request bodies in JWS provides authentication of requests. 481 JWS objects sent in ACME requests MUST meet the following additional 482 criteria: 484 o The JWS MUST be in the Flattened JSON Serialization [RFC7515] 486 o The JWS MUST NOT have multiple signatures 488 o The JWS Unencoded Payload Option [RFC7797] MUST NOT be used 490 o The JWS Unprotected Header [RFC7515] MUST NOT be used 492 o The JWS Payload MUST NOT be detached 494 o The JWS Protected Header MUST include the following fields: 496 * "alg" (Algorithm) 498 + This field MUST NOT contain "none" or a Message 499 Authentication Code (MAC)-based algorithm 501 * "nonce" (defined in Section 6.4 below) 503 * "url" (defined in Section 6.3 below) 505 * Either "jwk" (JSON Web Key) or "kid" (Key ID) as specified 506 below 508 An ACME server MUST implement the "ES256" signature algorithm 509 [RFC7518] and SHOULD implement the "EdDSA" signature algorithm using 510 the "Ed25519" variant (indicated by "crv") [RFC8037]. 512 The "jwk" and "kid" fields are mutually exclusive. Servers MUST 513 reject requests that contain both. 515 For newAccount requests, and for revokeCert requests authenticated by 516 certificate key, there MUST be a "jwk" field. This field MUST 517 contain the public key corresponding to the private key used to sign 518 the JWS. 520 For all other requests, the request is signed using an existing 521 account and there MUST be a "kid" field. This field MUST contain the 522 account URL received by POSTing to the newAccount resource. 524 Note that authentication via signed JWS request bodies implies that 525 GET requests are not authenticated. Servers MUST NOT respond to GET 526 requests for resources that might be considered sensitive. Account 527 resources are the only sensitive resources defined in this 528 specification. 530 If the client sends a JWS signed with an algorithm that the server 531 does not support, then the server MUST return an error with status 532 code 400 (Bad Request) and type 533 "urn:ietf:params:acme:error:badSignatureAlgorithm" (see Section 6.6). 534 The problem document returned with the error MUST include an 535 "algorithms" field with an array of supported "alg" values. 537 Because client requests in ACME carry JWS objects in the Flattened 538 JSON Serialization, they must have the "Content-Type" header field 539 set to "application/jose+json". If a request does not meet this 540 requirement, then the server MUST return a response with status code 541 415 (Unsupported Media Type). 543 6.3. Request URL Integrity 545 It is common in deployment for the entity terminating TLS for HTTPS 546 to be different from the entity operating the logical HTTPS server, 547 with a "request routing" layer in the middle. For example, an ACME 548 CA might have a content delivery network terminate TLS connections 549 from clients so that it can inspect client requests for denial-of- 550 service protection. 552 These intermediaries can also change values in the request that are 553 not signed in the HTTPS request, e.g., the request URL and headers. 554 ACME uses JWS to provide an integrity mechanism, which protects 555 against an intermediary changing the request URL to another ACME URL. 557 As noted in Section 6.2 above, all ACME request objects carry a "url" 558 header parameter in their protected header. This header parameter 559 encodes the URL to which the client is directing the request. On 560 receiving such an object in an HTTP request, the server MUST compare 561 the "url" header parameter to the request URL. If the two do not 562 match, then the server MUST reject the request as unauthorized. 564 Except for the directory resource, all ACME resources are addressed 565 with URLs provided to the client by the server. In requests sent to 566 these resources, the client MUST set the "url" header parameter to 567 the exact string provided by the server (rather than performing any 568 re-encoding on the URL). The server SHOULD perform the corresponding 569 string equality check, configuring each resource with the URL string 570 provided to clients and having the resource check that requests have 571 the same string in their "url" header parameter. 573 6.3.1. "url" (URL) JWS Header Parameter 575 The "url" header parameter specifies the URL [RFC3986] to which this 576 JWS object is directed. The "url" header parameter MUST be carried 577 in the protected header of the JWS. The value of the "url" header 578 parameter MUST be a string representing the URL. 580 6.4. Replay protection 582 In order to protect ACME resources from any possible replay attacks, 583 ACME requests have a mandatory anti-replay mechanism. This mechanism 584 is based on the server maintaining a list of nonces that it has 585 issued to clients, and requiring any signed request from the client 586 to carry such a nonce. 588 An ACME server provides nonces to clients using the Replay-Nonce 589 header field, as specified in Section 6.4.1 below. The server MUST 590 include a Replay-Nonce header field in every successful response to a 591 POST request and SHOULD provide it in error responses as well. 593 Every JWS sent by an ACME client MUST include, in its protected 594 header, the "nonce" header parameter, with contents as defined in 595 Section 6.4.2 below. As part of JWS verification, the ACME server 596 MUST verify that the value of the "nonce" header is a value that the 597 server previously provided in a Replay-Nonce header field. Once a 598 nonce value has appeared in an ACME request, the server MUST consider 599 it invalid, in the same way as a value it had never issued. 601 When a server rejects a request because its nonce value was 602 unacceptable (or not present), it MUST provide HTTP status code 400 603 (Bad Request), and indicate the ACME error type 604 "urn:ietf:params:acme:error:badNonce". An error response with the 605 "badNonce" error type MUST include a Replay-Nonce header with a fresh 606 nonce. On receiving such a response, a client SHOULD retry the 607 request using the new nonce. 609 The precise method used to generate and track nonces is up to the 610 server. For example, the server could generate a random 128-bit 611 value for each response, keep a list of issued nonces, and strike 612 nonces from this list as they are used. 614 6.4.1. Replay-Nonce 616 The "Replay-Nonce" header field includes a server-generated value 617 that the server can use to detect unauthorized replay in future 618 client requests. The server MUST generate the value provided in 619 Replay-Nonce in such a way that they are unique to each message, with 620 high probability. For instance, it is acceptable to generate Replay- 621 Nonces randomly. 623 The value of the Replay-Nonce field MUST be an octet string encoded 624 according to the base64url encoding described in Section 2 of 625 [RFC7515]. Clients MUST ignore invalid Replay-Nonce values. 627 base64url = [A-Z] / [a-z] / [0-9] / "-" / "_" 629 Replay-Nonce = *base64url 631 The Replay-Nonce header field SHOULD NOT be included in HTTP request 632 messages. 634 6.4.2. "nonce" (Nonce) JWS Header Parameter 636 The "nonce" header parameter provides a unique value that enables the 637 verifier of a JWS to recognize when replay has occurred. The "nonce" 638 header parameter MUST be carried in the protected header of the JWS. 640 The value of the "nonce" header parameter MUST be an octet string, 641 encoded according to the base64url encoding described in Section 2 of 642 [RFC7515]. If the value of a "nonce" header parameter is not valid 643 according to this encoding, then the verifier MUST reject the JWS as 644 malformed. 646 6.5. Rate Limits 648 Creation of resources can be rate limited by ACME servers to ensure 649 fair usage and prevent abuse. Once the rate limit is exceeded, the 650 server MUST respond with an error with the type 651 "urn:ietf:params:acme:error:rateLimited". Additionally, the server 652 SHOULD send a "Retry-After" header indicating when the current 653 request may succeed again. If multiple rate limits are in place, 654 that is the time where all rate limits allow access again for the 655 current request with exactly the same parameters. 657 In addition to the human-readable "detail" field of the error 658 response, the server MAY send one or multiple link relations in the 659 "Link" header pointing to documentation about the specific rate limit 660 that was hit, using the "help" link relation type. 662 6.6. Errors 664 Errors can be reported in ACME both at the HTTP layer and within 665 challenge objects as defined in Section 8. ACME servers can return 666 responses with an HTTP error response code (4XX or 5XX). For 667 example: If the client submits a request using a method not allowed 668 in this document, then the server MAY return status code 405 (Method 669 Not Allowed). 671 When the server responds with an error status, it SHOULD provide 672 additional information using a problem document [RFC7807]. To 673 facilitate automatic response to errors, this document defines the 674 following standard tokens for use in the "type" field (within the 675 "urn:ietf:params:acme:error:" namespace): 677 +-------------------------+-----------------------------------------+ 678 | Type | Description | 679 +-------------------------+-----------------------------------------+ 680 | accountDoesNotExist | The request specified an account that | 681 | | does not exist | 682 | | | 683 | badCSR | The CSR is unacceptable (e.g., due to a | 684 | | short key) | 685 | | | 686 | badNonce | The client sent an unacceptable anti- | 687 | | replay nonce | 688 | | | 689 | badRevocationReason | The revocation reason provided is not | 690 | | allowed by the server | 691 | | | 692 | badSignatureAlgorithm | The JWS was signed with an algorithm | 693 | | the server does not support | 694 | | | 695 | caa | Certification Authority Authorization | 696 | | (CAA) records forbid the CA from | 697 | | issuing | 698 | | | 699 | compound | Specific error conditions are indicated | 700 | | in the "subproblems" array. | 701 | | | 702 | connection | The server could not connect to | 703 | | validation target | 704 | | | 705 | dns | There was a problem with a DNS query | 706 | | | 707 | externalAccountRequired | The request must include a value for | 708 | | the "externalAccountBinding" field | 709 | | | 710 | incorrectResponse | Response received didn't match the | 711 | | challenge's requirements | 712 | | | 713 | invalidContact | A contact URL for an account was | 714 | | invalid | 715 | | | 716 | malformed | The request message was malformed | 717 | | | 718 | rateLimited | The request exceeds a rate limit | 719 | | | 720 | rejectedIdentifier | The server will not issue for the | 721 | | identifier | 722 | | | 723 | serverInternal | The server experienced an internal | 724 | | error | 725 | | | 726 | tls | The server received a TLS error during | 727 | | validation | 728 | | | 729 | unauthorized | The client lacks sufficient | 730 | | authorization | 731 | | | 732 | unsupportedContact | A contact URL for an account used an | 733 | | unsupported protocol scheme | 734 | | | 735 | unsupportedIdentifier | Identifier is not supported, but may be | 736 | | in future | 737 | | | 738 | userActionRequired | Visit the "instance" URL and take | 739 | | actions specified there | 740 +-------------------------+-----------------------------------------+ 742 This list is not exhaustive. The server MAY return errors whose 743 "type" field is set to a URI other than those defined above. Servers 744 MUST NOT use the ACME URN [RFC3553] namespace for errors other than 745 the standard types. Clients SHOULD display the "detail" field of all 746 errors. 748 In the remainder of this document, we use the tokens in the table 749 above to refer to error types, rather than the full URNs. For 750 example, an "error of type 'badCSR'" refers to an error document with 751 "type" value "urn:ietf:params:acme:error:badCSR". 753 6.6.1. Subproblems 755 Sometimes a CA may need to return multiple errors in response to a 756 request. Additionally, the CA may need to attribute errors to 757 specific identifiers. For instance, a new-order request may contain 758 multiple identifiers for which the CA cannot issue. In this 759 situation, an ACME problem document MAY contain the "subproblems" 760 field, containing a JSON array of problem documents, each of which 761 MAY contain an "identifier" field. If present, the "identifier" 762 field MUST contain an ACME identifier (Section 9.7.7). The 763 "identifier" field MUST NOT be present at the top level in ACME 764 problem documents. It can only be present in subproblems. 765 Subproblems need not all have the same type, and do not need to match 766 the top level type. 768 ACME clients may choose to use the "identifier" field of a subproblem 769 as a hint that an operation would succeed if that identifier were 770 omitted. For instance, if an order contains ten DNS identifiers, and 771 the new-order request returns a problem document with two 772 subproblems, referencing two of those identifiers, the ACME client 773 may choose to submit another order containing only the eight 774 identifiers not listed in the problem document. 776 HTTP/1.1 403 Forbidden 777 Content-Type: application/problem+json 779 { 780 "type": "urn:ietf:params:acme:error:malformed", 781 "detail": "Some of the identifiers requested were rejected", 782 "subproblems": [ 783 { 784 "type": "urn:ietf:params:acme:error:malformed", 785 "detail": "Invalid underscore in DNS name \"_example.com\"", 786 "identifier": { 787 "type": "dns", 788 "value": "_example.com" 789 } 790 }, 791 { 792 "type": "urn:ietf:params:acme:error:rejectedIdentifier", 793 "detail": "This CA will not issue for \"example.net\"", 794 "identifier": { 795 "type": "dns", 796 "value": "example.net" 797 } 798 } 799 ] 800 } 801 7. Certificate Management 803 In this section, we describe the certificate management functions 804 that ACME enables: 806 o Account Creation 808 o Ordering a Certificate 810 o Identifier Authorization 812 o Certificate Issuance 814 o Certificate Revocation 816 7.1. Resources 818 ACME is structured as a REST application with the following types of 819 resources: 821 o Account resources, representing information about an account 822 (Section 7.1.2, Section 7.3) 824 o Order resources, representing an account's requests to issue 825 certificates (Section 7.1.3) 827 o Authorization resources, representing an account's authorization 828 to act for an identifier (Section 7.1.4) 830 o Challenge resources, representing a challenge to prove control of 831 an identifier (Section 7.5, Section 8) 833 o Certificate resources, representing issued certificates 834 (Section 7.4.2) 836 o A "directory" resource (Section 7.1.1) 838 o A "newNonce" resource (Section 7.2) 840 o A "newAccount" resource (Section 7.3) 842 o A "newOrder" resource (Section 7.4) 844 o A "revokeCert" resource (Section 7.6) 846 o A "keyChange" resource (Section 7.3.6) 848 The server MUST provide "directory" and "newNonce" resources. 850 ACME uses different URLs for different management functions. Each 851 function is listed in a directory along with its corresponding URL, 852 so clients only need to be configured with the directory URL. These 853 URLs are connected by a few different link relations [RFC5988]. 855 The "up" link relation is used with challenge resources to indicate 856 the authorization resource to which a challenge belongs. It is also 857 used from certificate resources to indicate a resource from which the 858 client may fetch a chain of CA certificates that could be used to 859 validate the certificate in the original resource. 861 The "index" link relation is present on all resources other than the 862 directory and indicates the URL of the directory. 864 The following diagram illustrates the relations between resources on 865 an ACME server. For the most part, these relations are expressed by 866 URLs provided as strings in the resources' JSON representations. 867 Lines with labels in quotes indicate HTTP link relations. 869 directory 870 | 871 +--> newNonce 872 | 873 +----------+----------+-----+-----+------------+ 874 | | | | | 875 | | | | | 876 V V V V V 877 newAccount newAuthz newOrder revokeCert keyChange 878 | | | 879 | | | 880 V | V 881 account | order --+--> finalize 882 | | | 883 | | +--> cert 884 | V 885 +---> authorization 886 | ^ 887 | | "up" 888 V | 889 challenge 891 ACME Resources and Relationships 893 The following table illustrates a typical sequence of requests 894 required to establish a new account with the server, prove control of 895 an identifier, issue a certificate, and fetch an updated certificate 896 some time after issuance. The "->" is a mnemonic for a Location 897 header pointing to a created resource. 899 +-----------------------+--------------------------+----------------+ 900 | Action | Request | Response | 901 +-----------------------+--------------------------+----------------+ 902 | Get directory | GET directory | 200 | 903 | | | | 904 | Get nonce | HEAD newNonce | 200 | 905 | | | | 906 | Create account | POST newAccount | 201 -> account | 907 | | | | 908 | Submit order | POST newOrder | 201 -> order | 909 | | | | 910 | Fetch challenges | GET order | 200 | 911 | | authorizations | | 912 | | | | 913 | Respond to challenges | POST challenge urls | 200 | 914 | | | | 915 | Poll for status | GET order | 200 | 916 | | | | 917 | Finalize order | POST order finalize | 200 | 918 | | | | 919 | Poll for status | GET order | 200 | 920 | | | | 921 | Download certificate | GET order certificate | 200 | 922 +-----------------------+--------------------------+----------------+ 924 The remainder of this section provides the details of how these 925 resources are structured and how the ACME protocol makes use of them. 927 7.1.1. Directory 929 In order to help clients configure themselves with the right URLs for 930 each ACME operation, ACME servers provide a directory object. This 931 should be the only URL needed to configure clients. It is a JSON 932 object, whose field names are drawn from the following table and 933 whose values are the corresponding URLs. 935 +------------+--------------------+ 936 | Field | URL in value | 937 +------------+--------------------+ 938 | newNonce | New nonce | 939 | | | 940 | newAccount | New account | 941 | | | 942 | newOrder | New order | 943 | | | 944 | newAuthz | New authorization | 945 | | | 946 | revokeCert | Revoke certificate | 947 | | | 948 | keyChange | Key change | 949 +------------+--------------------+ 951 There is no constraint on the URL of the directory except that it 952 should be different from the other ACME server resources' URLs, and 953 that it should not clash with other services. For instance: 955 o a host which functions as both an ACME and a Web server may want 956 to keep the root path "/" for an HTML "front page", and place the 957 ACME directory under the path "/acme". 959 o a host which only functions as an ACME server could place the 960 directory under the path "/". 962 If the ACME server does not implement pre-authorization 963 (Section 7.4.1) it MUST omit the "newAuthz" field of the directory. 965 The object MAY additionally contain a field "meta". If present, it 966 MUST be a JSON object; each field in the object is an item of 967 metadata relating to the service provided by the ACME server. 969 The following metadata items are defined, all of which are OPTIONAL: 971 termsOfService (optional, string): A URL identifying the current 972 terms of service. 974 website (optional, string): An HTTP or HTTPS URL locating a website 975 providing more information about the ACME server. 977 caaIdentities (optional, array of string): Each string MUST be a 978 lowercase hostname which the ACME server recognizes as referring 979 to itself for the purposes of CAA record validation as defined in 980 [RFC6844]. This allows clients to determine the correct issuer 981 domain name to use when configuring CAA records. 983 externalAccountRequired (optional, boolean): If this field is 984 present and set to "true", then the CA requires that all new- 985 account requests include an "externalAccountBinding" field 986 associating the new account with an external account. 988 Clients access the directory by sending a GET request to the 989 directory URL. 991 HTTP/1.1 200 OK 992 Content-Type: application/json 994 { 995 "newNonce": "https://example.com/acme/new-nonce", 996 "newAccount": "https://example.com/acme/new-account", 997 "newOrder": "https://example.com/acme/new-order", 998 "newAuthz": "https://example.com/acme/new-authz", 999 "revokeCert": "https://example.com/acme/revoke-cert", 1000 "keyChange": "https://example.com/acme/key-change", 1001 "meta": { 1002 "termsOfService": "https://example.com/acme/terms/2017-5-30", 1003 "website": "https://www.example.com/", 1004 "caaIdentities": ["example.com"], 1005 "externalAccountRequired": false 1006 } 1007 } 1009 7.1.2. Account Objects 1011 An ACME account resource represents a set of metadata associated with 1012 an account. Account resources have the following structure: 1014 status (required, string): The status of this account. Possible 1015 values are: "valid", "deactivated", and "revoked". The value 1016 "deactivated" should be used to indicate client-initiated 1017 deactivation whereas "revoked" should be used to indicate server- 1018 initiated deactivation. (See Section 7.1.6) 1020 contact (optional, array of string): An array of URLs that the 1021 server can use to contact the client for issues related to this 1022 account. For example, the server may wish to notify the client 1023 about server-initiated revocation or certificate expiration. 1025 termsOfServiceAgreed (optional, boolean): Including this field in a 1026 new-account request, with a value of true, indicates the client's 1027 agreement with the terms of service. This field is not updateable 1028 by the client. 1030 orders (required, string): A URL from which a list of orders 1031 submitted by this account can be fetched via a GET request, as 1032 described in Section 7.1.2.1. 1034 { 1035 "status": "valid", 1036 "contact": [ 1037 "mailto:cert-admin@example.com", 1038 "mailto:admin@example.com" 1039 ], 1040 "termsOfServiceAgreed": true, 1041 "orders": "https://example.com/acme/acct/1/orders" 1042 } 1044 7.1.2.1. Orders List 1046 Each account object includes an "orders" URL from which a list of 1047 orders created by the account can be fetched via GET request. The 1048 result of the GET request MUST be a JSON object whose "orders" field 1049 is an array of URLs, each identifying an order belonging to the 1050 account. The server SHOULD include pending orders, and SHOULD NOT 1051 include orders that are invalid in the array of URLs. The server MAY 1052 return an incomplete list, along with a Link header with a "next" 1053 link relation indicating where further entries can be acquired. 1055 HTTP/1.1 200 OK 1056 Content-Type: application/json 1057 Link: ;rel="next" 1059 { 1060 "orders": [ 1061 "https://example.com/acme/acct/1/order/1", 1062 "https://example.com/acme/acct/1/order/2", 1063 /* 47 more URLs not shown for example brevity */ 1064 "https://example.com/acme/acct/1/order/50" 1065 ] 1066 } 1068 7.1.3. Order Objects 1070 An ACME order object represents a client's request for a certificate 1071 and is used to track the progress of that order through to issuance. 1072 Thus, the object contains information about the requested 1073 certificate, the authorizations that the server requires the client 1074 to complete, and any certificates that have resulted from this order. 1076 status (required, string): The status of this order. Possible 1077 values are: "pending", "ready", "processing", "valid", and 1078 "invalid". (See Section 7.1.6) 1080 expires (optional, string): The timestamp after which the server 1081 will consider this order invalid, encoded in the format specified 1082 in RFC 3339 [RFC3339]. This field is REQUIRED for objects with 1083 "pending" or "valid" in the status field. 1085 identifiers (required, array of object): An array of identifier 1086 objects that the order pertains to. 1088 type (required, string): The type of identifier. This document 1089 defines the "dns" identifier type. See the registry defined in 1090 Section 9.7.7 for any others. 1092 value (required, string): The identifier itself. 1094 notBefore (optional, string): The requested value of the notBefore 1095 field in the certificate, in the date format defined in [RFC3339]. 1097 notAfter (optional, string): The requested value of the notAfter 1098 field in the certificate, in the date format defined in [RFC3339]. 1100 error (optional, object): The error that occurred while processing 1101 the order, if any. This field is structured as a problem document 1102 [RFC7807]. 1104 authorizations (required, array of string): For pending orders, the 1105 authorizations that the client needs to complete before the 1106 requested certificate can be issued (see Section 7.5), including 1107 unexpired authorizations that the client has completed in the past 1108 for identifiers specified in the order. The authorizations 1109 required are dictated by server policy and there may not be a 1:1 1110 relationship between the order identifiers and the authorizations 1111 required. For final orders (in the "valid" or "invalid" state), 1112 the authorizations that were completed. Each entry is a URL from 1113 which an authorization can be fetched with a GET request. 1115 finalize (required, string): A URL that a CSR must be POSTed to once 1116 all of the order's authorizations are satisfied to finalize the 1117 order. The result of a successful finalization will be the 1118 population of the certificate URL for the order. 1120 certificate (optional, string): A URL for the certificate that has 1121 been issued in response to this order. 1123 { 1124 "status": "valid", 1125 "expires": "2015-03-01T14:09:00Z", 1127 "identifiers": [ 1128 { "type": "dns", "value": "example.com" }, 1129 { "type": "dns", "value": "www.example.com" } 1130 ], 1132 "notBefore": "2016-01-01T00:00:00Z", 1133 "notAfter": "2016-01-08T00:00:00Z", 1135 "authorizations": [ 1136 "https://example.com/acme/authz/1234", 1137 "https://example.com/acme/authz/2345" 1138 ], 1140 "finalize": "https://example.com/acme/acct/1/order/1/finalize", 1142 "certificate": "https://example.com/acme/cert/1234" 1143 } 1145 Any identifier of type "dns" in a new-order request MAY have a 1146 wildcard domain name as its value. A wildcard domain name consists 1147 of a single asterisk character followed by a single full stop 1148 character ("*.") followed by a domain name as defined for use in the 1149 Subject Alternate Name Extension by RFC 5280 [RFC5280]. An 1150 authorization returned by the server for a wildcard domain name 1151 identifier MUST NOT include the asterisk and full stop ("*.") prefix 1152 in the authorization identifier value. The returned authorization 1153 MUST include the optional "wildcard" field, with a value of true. 1155 The elements of the "authorizations" and "identifiers" array are 1156 immutable once set. The server MUST NOT change the contents of 1157 either array after they are created. If a client observes a change 1158 in the contents of either array, then it SHOULD consider the order 1159 invalid. 1161 The "authorizations" array of the order SHOULD reflect all 1162 authorizations that the CA takes into account in deciding to issue, 1163 even if some authorizations were fulfilled in earlier orders or in 1164 pre-authorization transactions. For example, if a CA allows multiple 1165 orders to be fulfilled based on a single authorization transaction, 1166 then it SHOULD reflect that authorization in all of the orders. 1168 Note that just because an authorization URL is listed in the 1169 "authorizations" array of an order object doesn't mean that the 1170 client is required to take action. There are several reasons that 1171 the referenced authorizations may already be valid: 1173 o The client completed the authorization as part of a previous order 1175 o The client previously pre-authorized the identifier (see 1176 Section 7.4.1) 1178 o The server granted the client authorization based on an external 1179 account 1181 Clients should check the "status" field of an order to determine 1182 whether they need to take any action. 1184 7.1.4. Authorization Objects 1186 An ACME authorization object represents a server's authorization for 1187 an account to represent an identifier. In addition to the 1188 identifier, an authorization includes several metadata fields, such 1189 as the status of the authorization (e.g., "pending", "valid", or 1190 "revoked") and which challenges were used to validate possession of 1191 the identifier. 1193 The structure of an ACME authorization resource is as follows: 1195 identifier (required, object): The identifier that the account is 1196 authorized to represent 1198 type (required, string): The type of identifier. (See below and 1199 Section 9.7.7) 1201 value (required, string): The identifier itself. 1203 status (required, string): The status of this authorization. 1204 Possible values are: "pending", "valid", "invalid", "deactivated", 1205 "expired", and "revoked". (See Section 7.1.6) 1207 expires (optional, string): The timestamp after which the server 1208 will consider this authorization invalid, encoded in the format 1209 specified in RFC 3339 [RFC3339]. This field is REQUIRED for 1210 objects with "valid" in the "status" field. 1212 challenges (required, array of objects): For pending authorizations, 1213 the challenges that the client can fulfill in order to prove 1214 possession of the identifier. For final authorizations (in the 1215 "valid" or "invalid" state), the challenges that were used. Each 1216 array entry is an object with parameters required to validate the 1217 challenge. A client should attempt to fulfill one of these 1218 challenges, and a server should consider any one of the challenges 1219 sufficient to make the authorization valid. 1221 wildcard (optional, boolean): For authorizations created as a result 1222 of a newOrder request containing a DNS identifier with a value 1223 that contained a wildcard prefix this field MUST be present, and 1224 true. 1226 The only type of identifier defined by this specification is a fully- 1227 qualified domain name (type: "dns"). If a domain name contains non- 1228 ASCII Unicode characters it MUST be encoded using the rules defined 1229 in [RFC3492]. Servers MUST verify any identifier values that begin 1230 with the ASCII Compatible Encoding prefix "xn--" as defined in 1231 [RFC5890] are properly encoded. Wildcard domain names (with "*" as 1232 the first label) MUST NOT be included in authorization objects. If 1233 an authorization object conveys authorization for the base domain of 1234 a newOrder DNS type identifier with a wildcard prefix then the 1235 optional authorizations "wildcard" field MUST be present with a value 1236 of true. 1238 Section 8 describes a set of challenges for domain name validation. 1240 { 1241 "status": "valid", 1242 "expires": "2015-03-01T14:09:00Z", 1244 "identifier": { 1245 "type": "dns", 1246 "value": "example.org" 1247 }, 1249 "challenges": [ 1250 { 1251 "url": "https://example.com/acme/authz/1234/0", 1252 "type": "http-01", 1253 "status": "valid", 1254 "token": "DGyRejmCefe7v4NfDGDKfA", 1255 "validated": "2014-12-01T12:05:00Z" 1256 } 1257 ], 1259 "wildcard": false 1260 } 1262 7.1.5. Challenge Objects 1264 An ACME challenge object represents a server's offer to validate a 1265 client's possession of an identifier in a specific way. Unlike the 1266 other objects listed above, there is not a single standard structure 1267 for a challenge object. The contents of a challenge object depend on 1268 the validation method being used. The general structure of challenge 1269 objects and an initial set of validation methods are described in 1270 Section 8. 1272 7.1.6. Status Changes 1274 Each ACME object type goes through a simple state machine over its 1275 lifetime. The "status" field of the object indicates which state the 1276 object is currently in. 1278 Challenge objects are created in the "pending" state. They 1279 transition to the "processing" state when the client responds to the 1280 challenge (see Section 7.5.1) and the server begins attempting to 1281 validate that the client has completed the challenge. Note that 1282 within the "processing" state, the server may attempt to validate the 1283 challenge multiple times (see Section 8.2). Likewise, client 1284 requests for retries do not cause a state change. If validation is 1285 successful, the challenge moves to the "valid" state; if there is an 1286 error, the challenge moves to the "invalid" state. 1288 pending 1289 | 1290 | Receive 1291 | response 1292 V 1293 processing <-+ 1294 | | | Server retry or 1295 | | | client retry request 1296 | +----+ 1297 | 1298 | 1299 Successful | Failed 1300 validation | validation 1301 +---------+---------+ 1302 | | 1303 V V 1304 valid invalid 1306 State Transitions for Challenge Objects 1308 Authorization objects are created in the "pending" state. If one of 1309 the challenges listed in the authorization transitions to the "valid" 1310 state, then the authorization also changes to the "valid" state. If 1311 there is an error while the authorization is still pending, then the 1312 authorization transitions to the "invalid" state. Once the 1313 authorization is in the valid state, it can expire ("expired"), be 1314 deactivated by the client ("deactivated", see Section 7.5.2), or 1315 revoked by the server ("revoked"). 1317 pending --------------------+ 1318 | | 1319 | | 1320 Error | Challenge valid | 1321 +---------+---------+ | 1322 | | | 1323 V V | 1324 invalid valid | 1325 | | 1326 | | 1327 | | 1328 +--------------+--------------+ 1329 | | | 1330 | | | 1331 Server | Client | Time after | 1332 revoke | deactivate | "expires" | 1333 V V V 1334 revoked deactivated expired 1336 State Transitions for Authorization Objects 1338 Order objects are created in the "pending" state. Once all of the 1339 authorizations listed in the order object are in the "valid" state, 1340 the order transitions to the "ready" state. The order moves to the 1341 "processing" state after the client submits a request to the order's 1342 "finalize" URL and the CA begins the issuance process for the 1343 certificate. Once the certificate is issued, the order enters the 1344 "valid" state. If an error occurs at any of these stages, the order 1345 moves to the "invalid" state. The order also moves to the "invalid" 1346 state if it expires, or one of its authorizations enters a final 1347 state other than "valid" ("expired", "revoked", "deactivated"). 1349 pending --------------+ 1350 | | 1351 | All authz | 1352 | "valid" | 1353 V | 1354 ready ---------------+ 1355 | | 1356 | Receive | 1357 | finalize | 1358 | request | 1359 V | 1360 processing ------------+ 1361 | | 1362 | Certificate | Error or 1363 | issued | Authorization failure 1364 V V 1365 valid invalid 1367 State Transitions for Order Objects 1369 Account objects are created in the "valid" state, since no further 1370 action is required to create an account after a successful newAccount 1371 request. If the account is deactivated by the client or revoked by 1372 the server, it moves to the corresponding state. 1374 valid 1375 | 1376 | 1377 +-----------+-----------+ 1378 Client | Server | 1379 deactiv.| revoke | 1380 V V 1381 deactivated revoked 1383 State Transitions for Account Objects 1385 Note that some of these states may not ever appear in a "status" 1386 field, depending on server behavior. For example, a server that 1387 issues synchronously will never show an order in the "processing" 1388 state. A server that deletes expired authorizations immediately will 1389 never show an authorization in the "expired" state. 1391 7.2. Getting a Nonce 1393 Before sending a POST request to the server, an ACME client needs to 1394 have a fresh anti-replay nonce to put in the "nonce" header of the 1395 JWS. In most cases, the client will have gotten a nonce from a 1396 previous request. However, the client might sometimes need to get a 1397 new nonce, e.g., on its first request to the server or if an existing 1398 nonce is no longer valid. 1400 To get a fresh nonce, the client sends a HEAD request to the new- 1401 nonce resource on the server. The server's response MUST include a 1402 Replay-Nonce header field containing a fresh nonce, and SHOULD have 1403 status code 200 (OK). The server MUST also respond to GET requests 1404 for this resource, returning an empty body (while still providing a 1405 Replay-Nonce header) with a 204 (No Content) status. 1407 HEAD /acme/new-nonce HTTP/1.1 1408 Host: example.com 1410 HTTP/1.1 200 OK 1411 Replay-Nonce: oFvnlFP1wIhRlYS2jTaXbA 1412 Cache-Control: no-store 1414 Proxy caching of responses from the new-nonce resource can cause 1415 clients receive the same nonce repeatedly, leading to badNonce 1416 errors. The server MUST include a Cache-Control header field with 1417 the "no-store" directive in responses for the new-nonce resource, in 1418 order to prevent caching of this resource. 1420 7.3. Account Creation 1422 A client creates a new account with the server by sending a POST 1423 request to the server's new-account URL. The body of the request is 1424 a stub account object optionally containing the "contact" and 1425 "termsOfServiceAgreed" fields. 1427 contact (optional, array of string): Same meaning as the 1428 corresponding server field defined in Section 7.1.2 1430 termsOfServiceAgreed (optional, boolean): Same meaning as the 1431 corresponding server field defined in Section 7.1.2 1433 onlyReturnExisting (optional, boolean): If this field is present 1434 with the value "true", then the server MUST NOT create a new 1435 account if one does not already exist. This allows a client to 1436 look up an account URL based on an account key (see 1437 Section 7.3.1). 1439 externalAccountBinding (optional, object): An optional field for 1440 binding the new account with an existing non-ACME account (see 1441 Section 7.3.5). 1443 POST /acme/new-account HTTP/1.1 1444 Host: example.com 1445 Content-Type: application/jose+json 1447 { 1448 "protected": base64url({ 1449 "alg": "ES256", 1450 "jwk": {...}, 1451 "nonce": "6S8IqOGY7eL2lsGoTZYifg", 1452 "url": "https://example.com/acme/new-account" 1453 }), 1454 "payload": base64url({ 1455 "termsOfServiceAgreed": true, 1456 "contact": [ 1457 "mailto:cert-admin@example.com", 1458 "mailto:admin@example.com" 1459 ] 1460 }), 1461 "signature": "RZPOnYoPs1PhjszF...-nh6X1qtOFPB519I" 1462 } 1464 The server MUST ignore any values provided in the "orders" fields in 1465 account bodies sent by the client, as well as any other fields that 1466 it does not recognize. If new fields are specified in the future, 1467 the specification of those fields MUST describe whether they can be 1468 provided by the client. 1470 In general, the server MUST ignore any fields in the request object 1471 that it does not recognize. In particular, it MUST NOT reflect 1472 unrecognized fields in the resulting account object. This allows 1473 clients to detect when servers do not support an extension field. 1475 The server SHOULD validate that the contact URLs in the "contact" 1476 field are valid and supported by the server. If the server validates 1477 contact URLs it MUST support the "mailto" scheme. Clients MUST NOT 1478 provide a "mailto" URL in the "contact" field that contains "hfields" 1479 [RFC6068], or more than one "addr-spec" in the "to" component. If a 1480 server encounters a "mailto" contact URL that does not meet these 1481 criteria, then it SHOULD reject it as invalid. 1483 If the server rejects a contact URL for using an unsupported scheme 1484 it MUST return an error of type "unsupportedContact", with a 1485 description describing the error and what types of contact URLs the 1486 server considers acceptable. If the server rejects a contact URL for 1487 using a supported scheme but an invalid value then the server MUST 1488 return an error of type "invalidContact". 1490 If the server wishes to present the client with terms under which the 1491 ACME service is to be used, it MUST indicate the URL where such terms 1492 can be accessed in the "termsOfService" subfield of the "meta" field 1493 in the directory object, and the server MUST reject new-account 1494 requests that do not have the "termsOfServiceAgreed" field set to 1495 "true". Clients SHOULD NOT automatically agree to terms by default. 1496 Rather, they SHOULD require some user interaction for agreement to 1497 terms. 1499 The server creates an account and stores the public key used to 1500 verify the JWS (i.e., the "jwk" element of the JWS header) to 1501 authenticate future requests from the account. The server returns 1502 this account object in a 201 (Created) response, with the account URL 1503 in a Location header field. The account URL is used as the "kid" 1504 value in the JWS authenticating subsequent requests by this account 1505 (See Section 6.2). 1507 HTTP/1.1 201 Created 1508 Content-Type: application/json 1509 Replay-Nonce: D8s4D2mLs8Vn-goWuPQeKA 1510 Location: https://example.com/acme/acct/1 1511 Link: ;rel="index" 1513 { 1514 "status": "valid", 1516 "contact": [ 1517 "mailto:cert-admin@example.com", 1518 "mailto:admin@example.com" 1519 ], 1521 "orders": "https://example.com/acme/acct/1/orders" 1522 } 1524 7.3.1. Finding an Account URL Given a Key 1526 If the server receives a newAccount request signed with a key for 1527 which it already has an account registered with the provided account 1528 key, then it MUST return a response with a 200 (OK) status code and 1529 provide the URL of that account in the Location header field. The 1530 body of this response represents the account object as it existed on 1531 the server before this request; any fields in the request object MUST 1532 be ignored. This allows a client that has an account key but not the 1533 corresponding account URL to recover the account URL. 1535 If a client wishes to find the URL for an existing account and does 1536 not want an account to be created if one does not already exist, then 1537 it SHOULD do so by sending a POST request to the new-account URL with 1538 a JWS whose payload has an "onlyReturnExisting" field set to "true" 1539 ({"onlyReturnExisting": true}). If a client sends such a request and 1540 an account does not exist, then the server MUST return an error 1541 response with status code 400 (Bad Request) and type 1542 "urn:ietf:params:acme:error:accountDoesNotExist". 1544 7.3.2. Account Update 1546 If the client wishes to update this information in the future, it 1547 sends a POST request with updated information to the account URL. 1548 The server MUST ignore any updates to the "orders" field, 1549 "termsOfServiceAgreed" field (see Section 7.3.4), or any other fields 1550 it does not recognize. If the server accepts the update, it MUST 1551 return a response with a 200 (OK) status code and the resulting 1552 account object. 1554 For example, to update the contact information in the above account, 1555 the client could send the following request: 1557 POST /acme/acct/1 HTTP/1.1 1558 Host: example.com 1559 Content-Type: application/jose+json 1561 { 1562 "protected": base64url({ 1563 "alg": "ES256", 1564 "kid": "https://example.com/acme/acct/1", 1565 "nonce": "ax5RnthDqp_Yf4_HZnFLmA", 1566 "url": "https://example.com/acme/acct/1" 1567 }), 1568 "payload": base64url({ 1569 "contact": [ 1570 "mailto:certificates@example.com", 1571 "mailto:admin@example.com" 1572 ] 1573 }), 1574 "signature": "hDXzvcj8T6fbFbmn...rDzXzzvzpRy64N0o" 1575 } 1577 7.3.3. Account Information 1579 Servers MUST NOT respond to GET requests for account resources as 1580 these requests are not authenticated. If a client wishes to query 1581 the server for information about its account (e.g., to examine the 1582 "contact" or "orders" fields), then it SHOULD do so by sending a POST 1583 request with an empty update. That is, it should send a JWS whose 1584 payload is an empty object ({}). 1586 7.3.4. Changes of Terms of Service 1588 As described above, a client can indicate its agreement with the CA's 1589 terms of service by setting the "termsOfServiceAgreed" field in its 1590 account object to "true". 1592 If the server has changed its terms of service since a client 1593 initially agreed, and the server is unwilling to process a request 1594 without explicit agreement to the new terms, then it MUST return an 1595 error response with status code 403 (Forbidden) and type 1596 "urn:ietf:params:acme:error:userActionRequired". This response MUST 1597 include a Link header with link relation "terms-of-service" and the 1598 latest terms-of-service URL. 1600 The problem document returned with the error MUST also include an 1601 "instance" field, indicating a URL that the client should direct a 1602 human user to visit in order for instructions on how to agree to the 1603 terms. 1605 HTTP/1.1 403 Forbidden 1606 Replay-Nonce: IXVHDyxIRGcTE0VSblhPzw 1607 Link: ;rel="terms-of-service" 1608 Content-Type: application/problem+json 1609 Content-Language: en 1611 { 1612 "type": "urn:ietf:params:acme:error:userActionRequired", 1613 "detail": "Terms of service have changed", 1614 "instance": "https://example.com/acme/agreement/?token=W8Ih3PswD-8" 1615 } 1617 7.3.5. External Account Binding 1619 The server MAY require a value for the "externalAccountBinding" field 1620 to be present in "newAccount" requests. This can be used to 1621 associate an ACME account with an existing account in a non-ACME 1622 system, such as a CA customer database. 1624 To enable ACME account binding, the CA operating the ACME server 1625 needs to provide the ACME client with a MAC key and a key identifier, 1626 using some mechanism outside of ACME. The key identifier MUST be an 1627 ASCII string. The MAC key SHOULD be provided in base64url-encoded 1628 form, to maximize compatibility between non-ACME provisioning systems 1629 and ACME clients. 1631 The ACME client then computes a binding JWS to indicate the external 1632 account holder's approval of the ACME account key. The payload of 1633 this JWS is the account key being registered, in JWK form. The 1634 protected header of the JWS MUST meet the following criteria: 1636 o The "alg" field MUST indicate a MAC-based algorithm 1638 o The "kid" field MUST contain the key identifier provided by the CA 1640 o The "nonce" field MUST NOT be present 1642 o The "url" field MUST be set to the same value as the outer JWS 1644 The "signature" field of the JWS will contain the MAC value computed 1645 with the MAC key provided by the CA. 1647 POST /acme/new-account HTTP/1.1 1648 Host: example.com 1649 Content-Type: application/jose+json 1651 { 1652 "protected": base64url({ 1653 "alg": "ES256", 1654 "jwk": /* account key */, 1655 "nonce": "K60BWPrMQG9SDxBDS_xtSw", 1656 "url": "https://example.com/acme/new-account" 1657 }), 1658 "payload": base64url({ 1659 "contact": ["mailto:example@anonymous.invalid"], 1660 "termsOfServiceAgreed": true, 1662 "externalAccountBinding": { 1663 "protected": base64url({ 1664 "alg": "HS256", 1665 "kid": /* key identifier from CA */, 1666 "url": "https://example.com/acme/new-account" 1667 }), 1668 "payload": base64url(/* same as in "jwk" above */), 1669 "signature": /* MAC using MAC key from CA */ 1670 } 1671 }), 1672 "signature": "5TWiqIYQfIDfALQv...x9C2mg8JGPxl5bI4" 1673 } 1675 If a CA requires that new-account requests contain an 1676 "externalAccountBinding" field, then it MUST provide the value "true" 1677 in the "externalAccountRequired" subfield of the "meta" field in the 1678 directory object. If the CA receives a new-account request without 1679 an "externalAccountBinding" field, then it SHOULD reply with an error 1680 of type "externalAccountRequired". 1682 When a CA receives a new-account request containing an 1683 "externalAccountBinding" field, it decides whether or not to verify 1684 the binding. If the CA does not verify the binding, then it MUST NOT 1685 reflect the "externalAccountBinding" field in the resulting account 1686 object (if any). To verify the account binding, the CA MUST take the 1687 following steps: 1689 1. Verify that the value of the field is a well-formed JWS 1691 2. Verify that the JWS protected field meets the above criteria 1693 3. Retrieve the MAC key corresponding to the key identifier in the 1694 "kid" field 1696 4. Verify that the MAC on the JWS verifies using that MAC key 1698 5. Verify that the payload of the JWS represents the same key as was 1699 used to verify the outer JWS (i.e., the "jwk" field of the outer 1700 JWS) 1702 If all of these checks pass and the CA creates a new account, then 1703 the CA may consider the new account associated with the external 1704 account corresponding to the MAC key. The account object the CA 1705 returns MUST include an "externalAccountBinding" field with the same 1706 value as the field in the request. If any of these checks fail, then 1707 the CA MUST reject the new-account request. 1709 7.3.6. Account Key Roll-over 1711 A client may wish to change the public key that is associated with an 1712 account in order to recover from a key compromise or proactively 1713 mitigate the impact of an unnoticed key compromise. 1715 To change the key associated with an account, the client sends a 1716 request to the server containing signatures by both the old and new 1717 keys. The signature by the new key covers the account URL and the 1718 old key, signifying a request by the new key holder to take over the 1719 account from the old key holder. The signature by the old key covers 1720 this request and its signature, and indicates the old key holder's 1721 assent to the roll-over request. 1723 To create this request object, the client first constructs a key- 1724 change object describing the account to be updated and its account 1725 key: 1727 account (required, string): The URL for the account being modified. 1728 The content of this field MUST be the exact string provided in the 1729 Location header field in response to the new-account request that 1730 created the account. 1732 oldKey (required, JWK): The JWK representation of the old key 1734 The client then encapsulates the key-change object in an "inner" JWS, 1735 signed with the requested new account key. This "inner" JWS becomes 1736 the payload for the "outer" JWS that is the body of the ACME request. 1738 The outer JWS MUST meet the normal requirements for an ACME JWS (see 1739 Section 6.2). The inner JWS MUST meet the normal requirements, with 1740 the following differences: 1742 o The inner JWS MUST have a "jwk" header parameter, containing the 1743 public key of the new key pair. 1745 o The inner JWS MUST have the same "url" header parameter as the 1746 outer JWS. 1748 o The inner JWS is NOT REQUIRED to have a "nonce" header parameter. 1749 The server MUST ignore any value provided for the "nonce" header 1750 parameter. 1752 This transaction has signatures from both the old and new keys so 1753 that the server can verify that the holders of the two keys both 1754 agree to the change. The signatures are nested to preserve the 1755 property that all signatures on POST messages are signed by exactly 1756 one key. The "inner" JWS effectively represents a request by the 1757 holder of the new key to take over the account form the holder of the 1758 old key. The "outer" JWS represents the current account holder's 1759 assent to this request. 1761 POST /acme/key-change HTTP/1.1 1762 Host: example.com 1763 Content-Type: application/jose+json 1765 { 1766 "protected": base64url({ 1767 "alg": "ES256", 1768 "kid": "https://example.com/acme/acct/1", 1769 "nonce": "K60BWPrMQG9SDxBDS_xtSw", 1770 "url": "https://example.com/acme/key-change" 1771 }), 1772 "payload": base64url({ 1773 "protected": base64url({ 1774 "alg": "ES256", 1775 "jwk": /* new key */, 1776 "url": "https://example.com/acme/key-change" 1777 }), 1778 "payload": base64url({ 1779 "account": "https://example.com/acme/acct/1", 1780 "oldKey": /* old key */ 1781 }), 1782 "signature": "Xe8B94RD30Azj2ea...8BmZIRtcSKPSd8gU" 1783 }), 1784 "signature": "5TWiqIYQfIDfALQv...x9C2mg8JGPxl5bI4" 1785 } 1787 On receiving key-change request, the server MUST perform the 1788 following steps in addition to the typical JWS validation: 1790 1. Validate the POST request belongs to a currently active account, 1791 as described in Section 6. 1793 2. Check that the payload of the JWS is a well-formed JWS object 1794 (the "inner JWS"). 1796 3. Check that the JWS protected header of the inner JWS has a "jwk" 1797 field. 1799 4. Check that the inner JWS verifies using the key in its "jwk" 1800 field. 1802 5. Check that the payload of the inner JWS is a well-formed key- 1803 change object (as described above). 1805 6. Check that the "url" parameters of the inner and outer JWSs are 1806 the same. 1808 7. Check that the "account" field of the key-change object contains 1809 the URL for the account matching the old key (i.e., the "kid" 1810 field in the outer JWS). 1812 8. Check that the "oldKey" field of the key-change object is the 1813 same as the account key for the account in question. 1815 9. Check that no account exists whose account key is the same as the 1816 key in the "jwk" header parameter of the inner JWS. 1818 If all of these checks pass, then the server updates the 1819 corresponding account by replacing the old account key with the new 1820 public key and returns status code 200 (OK). Otherwise, the server 1821 responds with an error status code and a problem document describing 1822 the error. If there is an existing account with the new key 1823 provided, then the server SHOULD use status code 409 (Conflict) and 1824 provide the URL of that account in the Location header field. 1826 Note that changing the account key for an account SHOULD NOT have any 1827 other impact on the account. For example, the server MUST NOT 1828 invalidate pending orders or authorization transactions based on a 1829 change of account key. 1831 7.3.7. Account Deactivation 1833 A client can deactivate an account by posting a signed update to the 1834 server with a status field of "deactivated." Clients may wish to do 1835 this when the account key is compromised or decommissioned. 1837 POST /acme/acct/1 HTTP/1.1 1838 Host: example.com 1839 Content-Type: application/jose+json 1841 { 1842 "protected": base64url({ 1843 "alg": "ES256", 1844 "kid": "https://example.com/acme/acct/1", 1845 "nonce": "ntuJWWSic4WVNSqeUmshgg", 1846 "url": "https://example.com/acme/acct/1" 1847 }), 1848 "payload": base64url({ 1849 "status": "deactivated" 1850 }), 1851 "signature": "earzVLd3m5M4xJzR...bVTqn7R08AKOVf3Y" 1852 } 1853 The server MUST verify that the request is signed by the account key. 1854 If the server accepts the deactivation request, it replies with a 200 1855 (OK) status code and the current contents of the account object. 1857 Once an account is deactivated, the server MUST NOT accept further 1858 requests authorized by that account's key. The server SHOULD cancel 1859 any pending operations authorized by the account's key, such as 1860 certificate orders. A server may take a variety of actions in 1861 response to an account deactivation, e.g., deleting data related to 1862 that account or sending mail to the account's contacts. Servers 1863 SHOULD NOT revoke certificates issued by the deactivated account, 1864 since this could cause operational disruption for servers using these 1865 certificates. ACME does not provide a way to reactivate a 1866 deactivated account. 1868 7.4. Applying for Certificate Issuance 1870 The client begins the certificate issuance process by sending a POST 1871 request to the server's new-order resource. The body of the POST is 1872 a JWS object whose JSON payload is a subset of the order object 1873 defined in Section 7.1.3, containing the fields that describe the 1874 certificate to be issued: 1876 identifiers (required, array of object): An array of identifier 1877 objects that the client wishes to submit an order for. 1879 type (required, string): The type of identifier. 1881 value (required, string): The identifier itself. 1883 notBefore (optional, string): The requested value of the notBefore 1884 field in the certificate, in the date format defined in [RFC3339]. 1886 notAfter (optional, string): The requested value of the notAfter 1887 field in the certificate, in the date format defined in [RFC3339]. 1889 POST /acme/new-order HTTP/1.1 1890 Host: example.com 1891 Content-Type: application/jose+json 1893 { 1894 "protected": base64url({ 1895 "alg": "ES256", 1896 "kid": "https://example.com/acme/acct/1", 1897 "nonce": "5XJ1L3lEkMG7tR6pA00clA", 1898 "url": "https://example.com/acme/new-order" 1899 }), 1900 "payload": base64url({ 1901 "identifiers": [ 1902 { "type": "dns", "value": "example.com" } 1903 ], 1904 "notBefore": "2016-01-01T00:00:00Z", 1905 "notAfter": "2016-01-08T00:00:00Z" 1906 }), 1907 "signature": "H6ZXtGjTZyUnPeKn...wEA4TklBdh3e454g" 1908 } 1910 The server MUST return an error if it cannot fulfill the request as 1911 specified, and MUST NOT issue a certificate with contents other than 1912 those requested. If the server requires the request to be modified 1913 in a certain way, it should indicate the required changes using an 1914 appropriate error type and description. 1916 If the server is willing to issue the requested certificate, it 1917 responds with a 201 (Created) response. The body of this response is 1918 an order object reflecting the client's request and any 1919 authorizations the client must complete before the certificate will 1920 be issued. 1922 HTTP/1.1 201 Created 1923 Replay-Nonce: MYAuvOpaoIiywTezizk5vw 1924 Location: https://example.com/acme/order/asdf 1926 { 1927 "status": "pending", 1928 "expires": "2016-01-01T00:00:00Z", 1930 "notBefore": "2016-01-01T00:00:00Z", 1931 "notAfter": "2016-01-08T00:00:00Z", 1933 "identifiers": [ 1934 { "type": "dns", "value": "example.com" }, 1935 { "type": "dns", "value": "www.example.com" } 1936 ], 1938 "authorizations": [ 1939 "https://example.com/acme/authz/1234", 1940 "https://example.com/acme/authz/2345" 1941 ], 1943 "finalize": "https://example.com/acme/order/asdf/finalize" 1944 } 1946 The order object returned by the server represents a promise that if 1947 the client fulfills the server's requirements before the "expires" 1948 time, then the server will be willing to finalize the order upon 1949 request and issue the requested certificate. In the order object, 1950 any authorization referenced in the "authorizations" array whose 1951 status is "pending" represents an authorization transaction that the 1952 client must complete before the server will issue the certificate 1953 (see Section 7.5). If the client fails to complete the required 1954 actions before the "expires" time, then the server SHOULD change the 1955 status of the order to "invalid" and MAY delete the order resource. 1956 Clients SHOULD NOT make any assumptions about the sort order of 1957 "identifiers" or "authorizations" elements in the returned order 1958 object. 1960 Once the client believes it has fulfilled the server's requirements, 1961 it should send a POST request to the order resource's finalize URL. 1962 The POST body MUST include a CSR: 1964 csr (required, string): A CSR encoding the parameters for the 1965 certificate being requested [RFC2986]. The CSR is sent in the 1966 base64url-encoded version of the DER format. (Note: Because this 1967 field uses base64url, and does not include headers, it is 1968 different from PEM.). 1970 POST /acme/order/asdf/finalize HTTP/1.1 1971 Host: example.com 1972 Content-Type: application/jose+json 1974 { 1975 "protected": base64url({ 1976 "alg": "ES256", 1977 "kid": "https://example.com/acme/acct/1", 1978 "nonce": "MSF2j2nawWHPxxkE3ZJtKQ", 1979 "url": "https://example.com/acme/order/asdf/finalize" 1980 }), 1981 "payload": base64url({ 1982 "csr": "MIIBPTCBxAIBADBFMQ...FS6aKdZeGsysoCo4H9P", 1983 }), 1984 "signature": "uOrUfIIk5RyQ...nw62Ay1cl6AB" 1985 } 1987 The CSR encodes the client's requests with regard to the content of 1988 the certificate to be issued. The CSR MUST indicate the exact same 1989 set of requested identifiers as the initial new-order request. 1990 Identifiers of type "dns" MUST appear either in the commonName 1991 portion of the requested subject name, or in an extensionRequest 1992 attribute [RFC2985] requesting a subjectAltName extension. (These 1993 identifiers may appear in any sort order.) Specifications that 1994 define new identifier types must specify where in the certificate 1995 signing request these identifiers can appear. 1997 A request to finalize an order will result in error if the CA is 1998 unwilling to issue a certificate corresponding to the submitted CSR. 1999 For example: 2001 o If the order indicated does not have status "ready" 2003 o If the CSR and order identifiers differ 2005 o If the account is not authorized for the identifiers indicated in 2006 the CSR 2008 o If the CSR requests extensions that the CA is not willing to 2009 include 2011 In such cases, the problem document returned by the server SHOULD use 2012 error code "badCSR", and describe specific reasons the CSR was 2013 rejected in its "details" field. After returning such an error, the 2014 server SHOULD leave the order in the "ready" state, to allow the 2015 client to submit a new finalize request with an amended CSR. 2017 A valid request to finalize an order will return the order to be 2018 finalized. The client should begin polling the order by sending a 2019 GET request to the order resource to obtain its current state. The 2020 status of the order will indicate what action the client should take: 2022 o "invalid": The certificate will not be issued. Consider this 2023 order process abandoned. 2025 o "pending": The server does not believe that the client has 2026 fulfilled the requirements. Check the "authorizations" array for 2027 entries that are still pending. 2029 o "ready": The server agrees that the requirements have been 2030 fulfilled, and is awaiting finalization. Submit a finalization 2031 request. 2033 o "processing": The certificate is being issued. Send a GET request 2034 after the time given in the "Retry-After" header field of the 2035 response, if any. 2037 o "valid": The server has issued the certificate and provisioned its 2038 URL to the "certificate" field of the order. Download the 2039 certificate. 2041 HTTP/1.1 200 OK 2042 Replay-Nonce: CGf81JWBsq8QyIgPCi9Q9X 2043 Location: https://example.com/acme/order/asdf 2045 { 2046 "status": "valid", 2047 "expires": "2016-01-01T00:00:00Z", 2049 "notBefore": "2016-01-01T00:00:00Z", 2050 "notAfter": "2016-01-08T00:00:00Z", 2052 "identifiers": [ 2053 { "type": "dns", "value": "example.com" }, 2054 { "type": "dns", "value": "www.example.com" } 2055 ], 2057 "authorizations": [ 2058 "https://example.com/acme/authz/1234", 2059 "https://example.com/acme/authz/2345" 2060 ], 2062 "finalize": "https://example.com/acme/order/asdf/finalize", 2064 "certificate": "https://example.com/acme/cert/asdf" 2065 } 2067 7.4.1. Pre-Authorization 2069 The order process described above presumes that authorization objects 2070 are created reactively, in response to a certificate order. Some 2071 servers may also wish to enable clients to obtain authorization for 2072 an identifier proactively, outside of the context of a specific 2073 issuance. For example, a client hosting virtual servers for a 2074 collection of names might wish to obtain authorization before any 2075 virtual servers are created and only create a certificate when a 2076 virtual server starts up. 2078 In some cases, a CA running an ACME server might have a completely 2079 external, non-ACME process for authorizing a client to issue 2080 certificates for an identifier. In these cases, the CA should 2081 provision its ACME server with authorization objects corresponding to 2082 these authorizations and reflect them as already valid in any orders 2083 submitted by the client. 2085 If a CA wishes to allow pre-authorization within ACME, it can offer a 2086 "new authorization" resource in its directory by adding the field 2087 "newAuthz" with a URL for the new authorization resource. 2089 To request authorization for an identifier, the client sends a POST 2090 request to the new-authorization resource specifying the identifier 2091 for which authorization is being requested. 2093 identifier (required, object): The identifier to appear in the 2094 resulting authorization object (see Section 7.1.4) 2096 POST /acme/new-authz HTTP/1.1 2097 Host: example.com 2098 Content-Type: application/jose+json 2100 { 2101 "protected": base64url({ 2102 "alg": "ES256", 2103 "kid": "https://example.com/acme/acct/1", 2104 "nonce": "uQpSjlRb4vQVCjVYAyyUWg", 2105 "url": "https://example.com/acme/new-authz" 2106 }), 2107 "payload": base64url({ 2108 "identifier": { 2109 "type": "dns", 2110 "value": "example.net" 2111 } 2112 }), 2113 "signature": "nuSDISbWG8mMgE7H...QyVUL68yzf3Zawps" 2114 } 2116 Note that because the identifier in a pre-authorization request is 2117 the exact identifier to be included in the authorization object, pre- 2118 authorization cannot be used to authorize issuance with wildcard DNS 2119 identifiers. 2121 Before processing the authorization request, the server SHOULD 2122 determine whether it is willing to issue certificates for the 2123 identifier. For example, the server should check that the identifier 2124 is of a supported type. Servers might also check names against a 2125 blacklist of known high-value identifiers. If the server is 2126 unwilling to issue for the identifier, it SHOULD return a 403 2127 (Forbidden) error, with a problem document describing the reason for 2128 the rejection. 2130 If the server is willing to proceed, it builds a pending 2131 authorization object from the inputs submitted by the client: 2133 o "identifier" the identifier submitted by the client 2135 o "status" MUST be "pending" unless the server has out-of-band 2136 information about the client's authorization status 2138 o "challenges" as selected by the server's policy for this 2139 identifier 2141 The server allocates a new URL for this authorization, and returns a 2142 201 (Created) response, with the authorization URL in the Location 2143 header field, and the JSON authorization object in the body. The 2144 client then follows the process described in Section 7.5 to complete 2145 the authorization process. 2147 7.4.2. Downloading the Certificate 2149 To download the issued certificate, the client simply sends a GET 2150 request to the certificate URL. 2152 The default format of the certificate is application/pem-certificate- 2153 chain (see Section 9). 2155 The server MAY provide one or more link relation header fields 2156 [RFC5988] with relation "alternate". Each such field SHOULD express 2157 an alternative certificate chain starting with the same end-entity 2158 certificate. This can be used to express paths to various trust 2159 anchors. Clients can fetch these alternates and use their own 2160 heuristics to decide which is optimal. 2162 GET /acme/cert/asdf HTTP/1.1 2163 Host: example.com 2164 Accept: application/pkix-cert 2166 HTTP/1.1 200 OK 2167 Content-Type: application/pem-certificate-chain 2168 Link: ;rel="index" 2170 -----BEGIN CERTIFICATE----- 2171 [End-entity certificate contents] 2172 -----END CERTIFICATE----- 2173 -----BEGIN CERTIFICATE----- 2174 [Issuer certificate contents] 2175 -----END CERTIFICATE----- 2176 -----BEGIN CERTIFICATE----- 2177 [Other certificate contents] 2178 -----END CERTIFICATE----- 2180 A certificate resource represents a single, immutable certificate. 2181 If the client wishes to obtain a renewed certificate, the client 2182 initiates a new order process to request one. 2184 Because certificate resources are immutable once issuance is 2185 complete, the server MAY enable the caching of the resource by adding 2186 Expires and Cache-Control headers specifying a point in time in the 2187 distant future. These headers have no relation to the certificate's 2188 period of validity. 2190 The ACME client MAY request other formats by including an Accept 2191 header in its request. For example, the client could use the media 2192 type "application/pkix-cert" [RFC2585] to request the end-entity 2193 certificate in DER format. Server support for alternate formats is 2194 OPTIONAL. For formats that can only express a single certificate, 2195 the server SHOULD provide one or more "Link: rel="up"" headers 2196 pointing to an issuer or issuers so that ACME clients can build a 2197 certificate chain as defined in TLS. 2199 7.5. Identifier Authorization 2201 The identifier authorization process establishes the authorization of 2202 an account to manage certificates for a given identifier. This 2203 process assures the server of two things: 2205 1. That the client controls the private key of the account key pair, 2206 and 2208 2. That the client controls the identifier in question. 2210 This process may be repeated to associate multiple identifiers to a 2211 key pair (e.g., to request certificates with multiple identifiers), 2212 or to associate multiple accounts with an identifier (e.g., to allow 2213 multiple entities to manage certificates). 2215 Authorization resources are created by the server in response to 2216 certificate orders or authorization requests submitted by an account 2217 key holder; their URLs are provided to the client in the responses to 2218 these requests. The authorization object is implicitly tied to the 2219 account key used to sign the request. 2221 When a client receives an order from the server it downloads the 2222 authorization resources by sending GET requests to the indicated 2223 URLs. If the client initiates authorization using a request to the 2224 new authorization resource, it will have already received the pending 2225 authorization object in the response to that request. 2227 GET /acme/authz/1234 HTTP/1.1 2228 Host: example.com 2230 HTTP/1.1 200 OK 2231 Content-Type: application/json 2232 Link: ;rel="index" 2234 { 2235 "status": "pending", 2236 "expires": "2018-03-03T14:09:00Z", 2238 "identifier": { 2239 "type": "dns", 2240 "value": "example.org" 2241 }, 2243 "challenges": [ 2244 { 2245 "type": "http-01", 2246 "url": "https://example.com/acme/authz/1234/0", 2247 "token": "DGyRejmCefe7v4NfDGDKfA" 2248 }, 2249 { 2250 "type": "dns-01", 2251 "url": "https://example.com/acme/authz/1234/2", 2252 "token": "DGyRejmCefe7v4NfDGDKfA" 2253 } 2254 ], 2256 "wildcard": false 2257 } 2259 7.5.1. Responding to Challenges 2261 To prove control of the identifier and receive authorization, the 2262 client needs to respond with information to complete the challenges. 2263 To do this, the client updates the authorization object received from 2264 the server by filling in any required information in the elements of 2265 the "challenges" dictionary. 2267 The client sends these updates back to the server in the form of a 2268 JSON object with contents as specified by the challenge type, carried 2269 in a POST request to the challenge URL (not authorization URL) once 2270 it is ready for the server to attempt validation. 2272 For example, if the client were to respond to the "http-01" challenge 2273 in the above authorization, it would send the following request: 2275 POST /acme/authz/1234/0 HTTP/1.1 2276 Host: example.com 2277 Content-Type: application/jose+json 2279 { 2280 "protected": base64url({ 2281 "alg": "ES256", 2282 "kid": "https://example.com/acme/acct/1", 2283 "nonce": "Q_s3MWoqT05TrdkM2MTDcw", 2284 "url": "https://example.com/acme/authz/1234/0" 2285 }), 2286 "payload": base64url({}), 2287 "signature": "9cbg5JO1Gf5YLjjz...SpkUfcdPai9uVYYQ" 2288 } 2290 The server updates the authorization document by updating its 2291 representation of the challenge with the response object provided by 2292 the client. The server MUST ignore any fields in the response object 2293 that are not specified as response fields for this type of challenge. 2294 The server provides a 200 (OK) response with the updated challenge 2295 object as its body. 2297 If the client's response is invalid for any reason or does not 2298 provide the server with appropriate information to validate the 2299 challenge, then the server MUST return an HTTP error. On receiving 2300 such an error, the client SHOULD undo any actions that have been 2301 taken to fulfill the challenge, e.g., removing files that have been 2302 provisioned to a web server. 2304 The server is said to "finalize" the authorization when it has 2305 completed one of the validations, by assigning the authorization a 2306 status of "valid" or "invalid", corresponding to whether it considers 2307 the account authorized for the identifier. If the final state is 2308 "valid", then the server MUST include an "expires" field. When 2309 finalizing an authorization, the server MAY remove challenges other 2310 than the one that was completed, and may modify the "expires" field. 2311 The server SHOULD NOT remove challenges with status "invalid". 2313 Usually, the validation process will take some time, so the client 2314 will need to poll the authorization resource to see when it is 2315 finalized. For challenges where the client can tell when the server 2316 has validated the challenge (e.g., by seeing an HTTP or DNS request 2317 from the server), the client SHOULD NOT begin polling until it has 2318 seen the validation request from the server. 2320 To check on the status of an authorization, the client sends a GET 2321 request to the authorization URL, and the server responds with the 2322 current authorization object. In responding to poll requests while 2323 the validation is still in progress, the server MUST return a 200 2324 (OK) response and MAY include a Retry-After header field to suggest a 2325 polling interval to the client. 2327 GET /acme/authz/1234 HTTP/1.1 2328 Host: example.com 2330 HTTP/1.1 200 OK 2331 Content-Type: application/json 2333 { 2334 "status": "valid", 2335 "expires": "2018-09-09T14:09:00Z", 2337 "identifier": { 2338 "type": "dns", 2339 "value": "example.org" 2340 }, 2342 "challenges": [ 2343 { 2344 "type": "http-01", 2345 "url": "https://example.com/acme/authz/1234/0", 2346 "status": "valid", 2347 "validated": "2014-12-01T12:05:00Z", 2348 "token": "IlirfxKKXAsHtmzK29Pj8A" 2349 } 2350 ], 2352 "wildcard": false 2353 } 2355 7.5.2. Deactivating an Authorization 2357 If a client wishes to relinquish its authorization to issue 2358 certificates for an identifier, then it may request that the server 2359 deactivates each authorization associated with it by sending POST 2360 requests with the static object {"status": "deactivated"} to each 2361 authorization URL. 2363 POST /acme/authz/1234 HTTP/1.1 2364 Host: example.com 2365 Content-Type: application/jose+json 2367 { 2368 "protected": base64url({ 2369 "alg": "ES256", 2370 "kid": "https://example.com/acme/acct/1", 2371 "nonce": "xWCM9lGbIyCgue8di6ueWQ", 2372 "url": "https://example.com/acme/authz/1234" 2373 }), 2374 "payload": base64url({ 2375 "status": "deactivated" 2376 }), 2377 "signature": "srX9Ji7Le9bjszhu...WTFdtujObzMtZcx4" 2378 } 2380 The server MUST verify that the request is signed by the account key 2381 corresponding to the account that owns the authorization. If the 2382 server accepts the deactivation, it should reply with a 200 (OK) 2383 status code and the updated contents of the authorization object. 2385 The server MUST NOT treat deactivated authorization objects as 2386 sufficient for issuing certificates. 2388 7.6. Certificate Revocation 2390 To request that a certificate be revoked, the client sends a POST 2391 request to the ACME server's revokeCert URL. The body of the POST is 2392 a JWS object whose JSON payload contains the certificate to be 2393 revoked: 2395 certificate (required, string): The certificate to be revoked, in 2396 the base64url-encoded version of the DER format. (Note: Because 2397 this field uses base64url, and does not include headers, it is 2398 different from PEM.) 2400 reason (optional, int): One of the revocation reasonCodes defined in 2401 Section 5.3.1 of [RFC5280] to be used when generating OCSP 2402 responses and CRLs. If this field is not set the server SHOULD 2403 omit the reasonCode CRL entry extension when generating OCSP 2404 responses and CRLs. The server MAY disallow a subset of 2405 reasonCodes from being used by the user. If a request contains a 2406 disallowed reasonCode the server MUST reject it with the error 2407 type "urn:ietf:params:acme:error:badRevocationReason". The 2408 problem document detail SHOULD indicate which reasonCodes are 2409 allowed. 2411 Revocation requests are different from other ACME requests in that 2412 they can be signed either with an account key pair or the key pair in 2413 the certificate. 2415 Example using an account key pair for the signature: 2417 POST /acme/revoke-cert HTTP/1.1 2418 Host: example.com 2419 Content-Type: application/jose+json 2421 { 2422 "protected": base64url({ 2423 "alg": "ES256", 2424 "kid": "https://example.com/acme/acct/1", 2425 "nonce": "JHb54aT_KTXBWQOzGYkt9A", 2426 "url": "https://example.com/acme/revoke-cert" 2427 }), 2428 "payload": base64url({ 2429 "certificate": "MIIEDTCCAvegAwIBAgIRAP8...", 2430 "reason": 4 2431 }), 2432 "signature": "Q1bURgJoEslbD1c5...3pYdSMLio57mQNN4" 2433 } 2435 Example using the certificate key pair for the signature: 2437 POST /acme/revoke-cert HTTP/1.1 2438 Host: example.com 2439 Content-Type: application/jose+json 2441 { 2442 "protected": base64url({ 2443 "alg": "RS256", 2444 "jwk": /* certificate's public key */, 2445 "nonce": "JHb54aT_KTXBWQOzGYkt9A", 2446 "url": "https://example.com/acme/revoke-cert" 2447 }), 2448 "payload": base64url({ 2449 "certificate": "MIIEDTCCAvegAwIBAgIRAP8...", 2450 "reason": 1 2451 }), 2452 "signature": "Q1bURgJoEslbD1c5...3pYdSMLio57mQNN4" 2453 } 2455 Before revoking a certificate, the server MUST verify that the key 2456 used to sign the request is authorized to revoke the certificate. 2457 The server MUST consider at least the following accounts authorized 2458 for a given certificate: 2460 o the account that issued the certificate. 2462 o an account that holds authorizations for all of the identifiers in 2463 the certificate. 2465 The server MUST also consider a revocation request valid if it is 2466 signed with the private key corresponding to the public key in the 2467 certificate. 2469 If the revocation succeeds, the server responds with status code 200 2470 (OK). If the revocation fails, the server returns an error. 2472 HTTP/1.1 200 OK 2473 Replay-Nonce: IXVHDyxIRGcTE0VSblhPzw 2474 Content-Length: 0 2476 --- or --- 2478 HTTP/1.1 403 Forbidden 2479 Replay-Nonce: IXVHDyxIRGcTE0VSblhPzw 2480 Content-Type: application/problem+json 2481 Content-Language: en 2483 { 2484 "type": "urn:ietf:params:acme:error:unauthorized", 2485 "detail": "No authorization provided for name example.net" 2486 } 2488 8. Identifier Validation Challenges 2490 There are few types of identifiers in the world for which there is a 2491 standardized mechanism to prove possession of a given identifier. In 2492 all practical cases, CAs rely on a variety of means to test whether 2493 an entity applying for a certificate with a given identifier actually 2494 controls that identifier. 2496 Challenges provide the server with assurance that an account holder 2497 is also the entity that controls an identifier. For each type of 2498 challenge, it must be the case that in order for an entity to 2499 successfully complete the challenge the entity must both: 2501 o Hold the private key of the account key pair used to respond to 2502 the challenge 2504 o Control the identifier in question 2505 Section 10 documents how the challenges defined in this document meet 2506 these requirements. New challenges will need to document how they 2507 do. 2509 ACME uses an extensible challenge/response framework for identifier 2510 validation. The server presents a set of challenges in the 2511 authorization object it sends to a client (as objects in the 2512 "challenges" array), and the client responds by sending a response 2513 object in a POST request to a challenge URL. 2515 This section describes an initial set of challenge types. The 2516 definition of a challenge type includes: 2518 1. Content of challenge objects 2520 2. Content of response objects 2522 3. How the server uses the challenge and response to verify control 2523 of an identifier 2525 Challenge objects all contain the following basic fields: 2527 type (required, string): The type of challenge encoded in the 2528 object. 2530 url (required, string): The URL to which a response can be posted. 2532 status (required, string): The status of this challenge. Possible 2533 values are: "pending", "processing", "valid", and "invalid". (See 2534 Section 7.1.6) 2536 validated (optional, string): The time at which the server validated 2537 this challenge, encoded in the format specified in RFC 3339 2538 [RFC3339]. This field is REQUIRED if the "status" field is 2539 "valid". 2541 error (optional, object): Error that occurred while the server was 2542 validating the challenge, if any, structured as a problem document 2543 [RFC7807]. Multiple errors can be indicated by using subproblems 2544 Section 6.6.1. 2546 All additional fields are specified by the challenge type. If the 2547 server sets a challenge's "status" to "invalid", it SHOULD also 2548 include the "error" field to help the client diagnose why the 2549 challenge failed. 2551 Different challenges allow the server to obtain proof of different 2552 aspects of control over an identifier. In some challenges, like HTTP 2553 and DNS, the client directly proves its ability to do certain things 2554 related to the identifier. The choice of which challenges to offer 2555 to a client under which circumstances is a matter of server policy. 2557 The identifier validation challenges described in this section all 2558 relate to validation of domain names. If ACME is extended in the 2559 future to support other types of identifiers, there will need to be 2560 new challenge types, and they will need to specify which types of 2561 identifier they apply to. 2563 8.1. Key Authorizations 2565 All challenges defined in this document make use of a key 2566 authorization string. A key authorization is a string that expresses 2567 a domain holder's authorization for a specified key to satisfy a 2568 specified challenge, by concatenating the token for the challenge 2569 with a key fingerprint, separated by a "." character: 2571 keyAuthorization = token || '.' || base64url(JWK_Thumbprint(accountKey)) 2573 The "JWK_Thumbprint" step indicates the computation specified in 2574 [RFC7638], using the SHA-256 digest [FIPS180-4]. As noted in 2575 [RFC7518] any prepended zero octets in the fields of a JWK object 2576 MUST be stripped before doing the computation. 2578 As specified in the individual challenges below, the token for a 2579 challenge is a string comprised entirely of characters in the URL- 2580 safe base64 alphabet. The "||" operator indicates concatenation of 2581 strings. 2583 8.2. Retrying Challenges 2585 ACME challenges typically require the client to set up some network- 2586 accessible resource that the server can query in order to validate 2587 that the client controls an identifier. In practice it is not 2588 uncommon for the server's queries to fail while a resource is being 2589 set up, e.g., due to information propagating across a cluster or 2590 firewall rules not being in place. 2592 Clients SHOULD NOT respond to challenges until they believe that the 2593 server's queries will succeed. If a server's initial validation 2594 query fails, the server SHOULD retry the query after some time, in 2595 order to account for delay in setting up responses such as DNS 2596 records or HTTP resources. The precise retry schedule is up to the 2597 server, but server operators should keep in mind the operational 2598 scenarios that the schedule is trying to accommodate. Given that 2599 retries are intended to address things like propagation delays in 2600 HTTP or DNS provisioning, there should not usually be any reason to 2601 retry more often than every 5 or 10 seconds. While the server is 2602 still trying, the status of the challenge remains "processing"; it is 2603 only marked "invalid" once the server has given up. 2605 The server MUST provide information about its retry state to the 2606 client via the "error" field in the challenge and the Retry-After 2607 HTTP header field in response to requests to the challenge resource. 2608 The server MUST add an entry to the "error" field in the challenge 2609 after each failed validation query. The server SHOULD set the Retry- 2610 After header field to a time after the server's next validation 2611 query, since the status of the challenge will not change until that 2612 time. 2614 Clients can explicitly request a retry by re-sending their response 2615 to a challenge in a new POST request (with a new nonce, etc.). This 2616 allows clients to request a retry when the state has changed (e.g., 2617 after firewall rules have been updated). Servers SHOULD retry a 2618 request immediately on receiving such a POST request. In order to 2619 avoid denial-of-service attacks via client-initiated retries, servers 2620 SHOULD rate-limit such requests. 2622 8.3. HTTP Challenge 2624 With HTTP validation, the client in an ACME transaction proves its 2625 control over a domain name by proving that it can provision HTTP 2626 resources on a server accessible under that domain name. The ACME 2627 server challenges the client to provision a file at a specific path, 2628 with a specific string as its content. 2630 As a domain may resolve to multiple IPv4 and IPv6 addresses, the 2631 server will connect to at least one of the hosts found in the DNS A 2632 and AAAA records, at its discretion. Because many web servers 2633 allocate a default HTTPS virtual host to a particular low-privilege 2634 tenant user in a subtle and non-intuitive manner, the challenge must 2635 be completed over HTTP, not HTTPS. 2637 type (required, string): The string "http-01" 2639 token (required, string): A random value that uniquely identifies 2640 the challenge. This value MUST have at least 128 bits of entropy. 2641 It MUST NOT contain any characters outside the base64url alphabet, 2642 and MUST NOT include base64 padding characters ("="). 2644 GET /acme/authz/1234/0 HTTP/1.1 2645 Host: example.com 2647 HTTP/1.1 200 OK 2648 Content-Type: application/json 2650 { 2651 "type": "http-01", 2652 "url": "https://example.com/acme/authz/0", 2653 "status": "pending", 2654 "token": "LoqXcYV8q5ONbJQxbmR7SCTNo3tiAXDfowyjxAjEuX0" 2655 } 2657 A client fulfills this challenge by constructing a key authorization 2658 from the "token" value provided in the challenge and the client's 2659 account key. The client then provisions the key authorization as a 2660 resource on the HTTP server for the domain in question. 2662 The path at which the resource is provisioned is comprised of the 2663 fixed prefix "/.well-known/acme-challenge/", followed by the "token" 2664 value in the challenge. The value of the resource MUST be the ASCII 2665 representation of the key authorization. 2667 GET /.well-known/acme-challenge/LoqXcYV8q5ONbJQxbmR7SCTNo3tiAXDfowyjxAjEuX0 2668 Host: example.org 2670 HTTP/1.1 200 OK 2671 Content-Type: application/octet-stream 2673 LoqXcYV8q5ONbJQxbmR7SCTNo3tiAXDfowyjxAjEuX0.9jg46WB3rR_AHD-EBXdN7cBkH1WOu0tA3M9fm21mqTI 2675 A client responds with an empty object ({}) to acknowledge that the 2676 challenge can be validated by the server. 2678 POST /acme/authz/1234/0 2679 Host: example.com 2680 Content-Type: application/jose+json 2682 { 2683 "protected": base64url({ 2684 "alg": "ES256", 2685 "kid": "https://example.com/acme/acct/1", 2686 "nonce": "JHb54aT_KTXBWQOzGYkt9A", 2687 "url": "https://example.com/acme/authz/1234/0" 2688 }), 2689 "payload": base64url({}), 2690 "signature": "Q1bURgJoEslbD1c5...3pYdSMLio57mQNN4" 2691 } 2692 On receiving a response, the server constructs and stores the key 2693 authorization from the challenge "token" value and the current client 2694 account key. 2696 Given a challenge/response pair, the server verifies the client's 2697 control of the domain by verifying that the resource was provisioned 2698 as expected. 2700 1. Construct a URL by populating the URL template [RFC6570] 2701 "http://{domain}/.well-known/acme-challenge/{token}", where: 2703 * the domain field is set to the domain name being verified; and 2705 * the token field is set to the token in the challenge. 2707 2. Verify that the resulting URL is well-formed. 2709 3. Dereference the URL using an HTTP GET request. This request MUST 2710 be sent to TCP port 80 on the HTTP server. 2712 4. Verify that the body of the response is well-formed key 2713 authorization. The server SHOULD ignore whitespace characters at 2714 the end of the body. 2716 5. Verify that key authorization provided by the HTTP server matches 2717 the key authorization stored by the server. 2719 The server SHOULD follow redirects when dereferencing the URL. 2721 If all of the above verifications succeed, then the validation is 2722 successful. If the request fails, or the body does not pass these 2723 checks, then it has failed. 2725 8.4. DNS Challenge 2727 When the identifier being validated is a domain name, the client can 2728 prove control of that domain by provisioning a TXT resource record 2729 containing a designated value for a specific validation domain name. 2731 type (required, string): The string "dns-01" 2733 token (required, string): A random value that uniquely identifies 2734 the challenge. This value MUST have at least 128 bits of entropy. 2735 It MUST NOT contain any characters outside the base64url alphabet, 2736 including padding characters ("="). 2738 GET /acme/authz/1234/2 HTTP/1.1 2739 Host: example.com 2741 HTTP/1.1 200 OK 2742 Content-Type: application/json 2744 { 2745 "type": "dns-01", 2746 "url": "https://example.com/acme/authz/1234/2", 2747 "status": "pending", 2748 "token": "evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA" 2749 } 2751 A client fulfills this challenge by constructing a key authorization 2752 from the "token" value provided in the challenge and the client's 2753 account key. The client then computes the SHA-256 digest [FIPS180-4] 2754 of the key authorization. 2756 The record provisioned to the DNS contains the base64url encoding of 2757 this digest. The client constructs the validation domain name by 2758 prepending the label "_acme-challenge" to the domain name being 2759 validated, then provisions a TXT record with the digest value under 2760 that name. For example, if the domain name being validated is 2761 "example.org", then the client would provision the following DNS 2762 record: 2764 _acme-challenge.example.org. 300 IN TXT "gfj9Xq...Rg85nM" 2766 A client responds with an empty object ({}) to acknowledge that the 2767 challenge can be validated by the server. 2769 POST /acme/authz/1234/2 2770 Host: example.com 2771 Content-Type: application/jose+json 2773 { 2774 "protected": base64url({ 2775 "alg": "ES256", 2776 "kid": "https://example.com/acme/acct/1", 2777 "nonce": "JHb54aT_KTXBWQOzGYkt9A", 2778 "url": "https://example.com/acme/authz/1234/2" 2779 }), 2780 "payload": base64url({}), 2781 "signature": "Q1bURgJoEslbD1c5...3pYdSMLio57mQNN4" 2782 } 2783 On receiving a response, the server constructs and stores the key 2784 authorization from the challenge "token" value and the current client 2785 account key. 2787 To validate a DNS challenge, the server performs the following steps: 2789 1. Compute the SHA-256 digest [FIPS180-4] of the stored key 2790 authorization 2792 2. Query for TXT records for the validation domain name 2794 3. Verify that the contents of one of the TXT records match the 2795 digest value 2797 If all of the above verifications succeed, then the validation is 2798 successful. If no DNS record is found, or DNS record and response 2799 payload do not pass these checks, then the validation fails. 2801 9. IANA Considerations 2803 9.1. MIME Type: application/pem-certificate-chain 2805 The "Media Types" registry should be updated with the following 2806 additional value: 2808 MIME media type name: application 2810 MIME subtype name: pem-certificate-chain 2812 Required parameters: None 2814 Optional parameters: None 2816 Encoding considerations: None 2818 Security considerations: Carries a cryptographic certificate and its 2819 associated certificate chain 2821 Interoperability considerations: None 2823 Published specification: draft-ietf-acme-acme [[ RFC EDITOR: Please 2824 replace draft-ietf-acme-acme above with the RFC number assigned to 2825 this ]] 2827 Applications which use this media type: Any MIME-compliant transport 2829 Additional information: 2831 File contains one or more certificates encoded with the PEM textual 2832 encoding, according to RFC 7468 [RFC7468]. In order to provide easy 2833 interoperation with TLS, the first certificate MUST be an end-entity 2834 certificate. Each following certificate SHOULD directly certify the 2835 one preceding it. Because certificate validation requires that trust 2836 anchors be distributed independently, a certificate that specifies a 2837 trust anchor MAY be omitted from the chain, provided that supported 2838 peers are known to possess any omitted certificates. 2840 9.2. Well-Known URI for the HTTP Challenge 2842 The "Well-Known URIs" registry should be updated with the following 2843 additional value (using the template from [RFC5785]): 2845 URI suffix: acme-challenge 2847 Change controller: IETF 2849 Specification document(s): This document, Section Section 8.3 2851 Related information: N/A 2853 9.3. Replay-Nonce HTTP Header 2855 The "Message Headers" registry should be updated with the following 2856 additional value: 2858 +-------------------+----------+----------+---------------+ 2859 | Header Field Name | Protocol | Status | Reference | 2860 +-------------------+----------+----------+---------------+ 2861 | Replay-Nonce | http | standard | Section 6.4.1 | 2862 +-------------------+----------+----------+---------------+ 2864 9.4. "url" JWS Header Parameter 2866 The "JSON Web Signature and Encryption Header Parameters" registry 2867 should be updated with the following additional value: 2869 o Header Parameter Name: "url" 2871 o Header Parameter Description: URL 2873 o Header Parameter Usage Location(s): JWE, JWS 2875 o Change Controller: IESG 2877 o Specification Document(s): Section 6.3.1 of RFC XXXX 2879 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2880 to this document ]] 2882 9.5. "nonce" JWS Header Parameter 2884 The "JSON Web Signature and Encryption Header Parameters" registry 2885 should be updated with the following additional value: 2887 o Header Parameter Name: "nonce" 2889 o Header Parameter Description: Nonce 2891 o Header Parameter Usage Location(s): JWE, JWS 2893 o Change Controller: IESG 2895 o Specification Document(s): Section 6.4.2 of RFC XXXX 2897 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2898 to this document ]] 2900 9.6. URN Sub-namespace for ACME (urn:ietf:params:acme) 2902 The "IETF URN Sub-namespace for Registered Protocol Parameter 2903 Identifiers" registry should be updated with the following additional 2904 value, following the template in [RFC3553]: 2906 Registry name: acme 2908 Specification: RFC XXXX 2910 Repository: URL-TBD 2912 Index value: No transformation needed. 2914 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2915 to this document, and replace URL-TBD with the URL assigned by IANA 2916 for registries of ACME parameters. ]] 2918 9.7. New Registries 2920 This document requests that IANA create the following new registries: 2922 1. ACME Account Object Fields (Section 9.7.1) 2924 2. ACME Order Object Fields (Section 9.7.2) 2926 3. ACME Authorization Object Fields (Section 9.7.3) 2927 4. ACME Error Types (Section 9.7.4) 2929 5. ACME Resource Types (Section 9.7.5) 2931 6. ACME Directory Metadata Fields (Section 9.7.6) 2933 7. ACME Identifier Types (Section 9.7.7) 2935 8. ACME Validation Methods (Section 9.7.8) 2937 All of these registries are under a heading of "Automated Certificate 2938 Management Environment (ACME) Protocol" and are administered under a 2939 Specification Required policy [RFC8126]. 2941 9.7.1. Fields in Account Objects 2943 This registry lists field names that are defined for use in ACME 2944 account objects. Fields marked as "configurable" may be included in 2945 a new-account request. 2947 Template: 2949 o Field name: The string to be used as a field name in the JSON 2950 object 2952 o Field type: The type of value to be provided, e.g., string, 2953 boolean, array of string 2955 o Client configurable: Boolean indicating whether the server should 2956 accept values provided by the client 2958 o Reference: Where this field is defined 2960 Initial contents: The fields and descriptions defined in 2961 Section 7.1.2. 2963 +------------------------+---------------+--------------+-----------+ 2964 | Field Name | Field Type | Configurable | Reference | 2965 +------------------------+---------------+--------------+-----------+ 2966 | status | string | false | RFC XXXX | 2967 | | | | | 2968 | contact | array of | true | RFC XXXX | 2969 | | string | | | 2970 | | | | | 2971 | externalAccountBinding | object | true | RFC XXXX | 2972 | | | | | 2973 | termsOfServiceAgreed | boolean | true | RFC XXXX | 2974 | | | | | 2975 | orders | string | false | RFC XXXX | 2976 +------------------------+---------------+--------------+-----------+ 2978 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2979 to this document ]] 2981 9.7.2. Fields in Order Objects 2983 This registry lists field names that are defined for use in ACME 2984 order objects. Fields marked as "configurable" may be included in a 2985 new-order request. 2987 Template: 2989 o Field name: The string to be used as a field name in the JSON 2990 object 2992 o Field type: The type of value to be provided, e.g., string, 2993 boolean, array of string 2995 o Client configurable: Boolean indicating whether the server should 2996 accept values provided by the client 2998 o Reference: Where this field is defined 3000 Initial contents: The fields and descriptions defined in 3001 Section 7.1.3. 3003 +----------------+-----------------+--------------+-----------+ 3004 | Field Name | Field Type | Configurable | Reference | 3005 +----------------+-----------------+--------------+-----------+ 3006 | status | string | false | RFC XXXX | 3007 | | | | | 3008 | expires | string | false | RFC XXXX | 3009 | | | | | 3010 | identifiers | array of object | true | RFC XXXX | 3011 | | | | | 3012 | notBefore | string | true | RFC XXXX | 3013 | | | | | 3014 | notAfter | string | true | RFC XXXX | 3015 | | | | | 3016 | authorizations | array of string | false | RFC XXXX | 3017 | | | | | 3018 | finalize | string | false | RFC XXXX | 3019 | | | | | 3020 | certificate | string | false | RFC XXXX | 3021 +----------------+-----------------+--------------+-----------+ 3023 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 3024 to this document ]] 3026 9.7.3. Fields in Authorization Objects 3028 This registry lists field names that are defined for use in ACME 3029 authorization objects. Fields marked as "configurable" may be 3030 included in a new-authorization request. 3032 Template: 3034 o Field name: The string to be used as a field name in the JSON 3035 object 3037 o Field type: The type of value to be provided, e.g., string, 3038 boolean, array of string 3040 o Client configurable: Boolean indicating whether the server should 3041 accept values provided by the client 3043 o Reference: Where this field is defined 3045 Initial contents: The fields and descriptions defined in 3046 Section 7.1.4. 3048 +------------+-----------------+--------------+-----------+ 3049 | Field Name | Field Type | Configurable | Reference | 3050 +------------+-----------------+--------------+-----------+ 3051 | identifier | object | true | RFC XXXX | 3052 | | | | | 3053 | status | string | false | RFC XXXX | 3054 | | | | | 3055 | expires | string | false | RFC XXXX | 3056 | | | | | 3057 | challenges | array of object | false | RFC XXXX | 3058 | | | | | 3059 | wildcard | boolean | false | RFC XXXX | 3060 +------------+-----------------+--------------+-----------+ 3062 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 3063 to this document ]] 3065 9.7.4. Error Types 3067 This registry lists values that are used within URN values that are 3068 provided in the "type" field of problem documents in ACME. 3070 Template: 3072 o Type: The label to be included in the URN for this error, 3073 following "urn:ietf:params:acme:error:" 3075 o Description: A human-readable description of the error 3077 o Reference: Where the error is defined 3079 Initial contents: The types and descriptions in the table in 3080 Section 6.6 above, with the Reference field set to point to this 3081 specification. 3083 9.7.5. Resource Types 3085 This registry lists the types of resources that ACME servers may list 3086 in their directory objects. 3088 Template: 3090 o Field name: The value to be used as a field name in the directory 3091 object 3093 o Resource type: The type of resource labeled by the field 3095 o Reference: Where the resource type is defined 3096 Initial contents: 3098 +------------+--------------------+-----------+ 3099 | Field Name | Resource Type | Reference | 3100 +------------+--------------------+-----------+ 3101 | newNonce | New nonce | RFC XXXX | 3102 | | | | 3103 | newAccount | New account | RFC XXXX | 3104 | | | | 3105 | newOrder | New order | RFC XXXX | 3106 | | | | 3107 | newAuthz | New authorization | RFC XXXX | 3108 | | | | 3109 | revokeCert | Revoke certificate | RFC XXXX | 3110 | | | | 3111 | keyChange | Key change | RFC XXXX | 3112 | | | | 3113 | meta | Metadata object | RFC XXXX | 3114 +------------+--------------------+-----------+ 3116 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 3117 to this document ]] 3119 9.7.6. Fields in the "meta" Object within a Directory Object 3121 This registry lists field names that are defined for use in the JSON 3122 object included in the "meta" field of an ACME directory object. 3124 Template: 3126 o Field name: The string to be used as a field name in the JSON 3127 object 3129 o Field type: The type of value to be provided, e.g., string, 3130 boolean, array of string 3132 o Reference: Where this field is defined 3134 Initial contents: The fields and descriptions defined in 3135 Section 7.1.2. 3137 +-------------------------+-----------------+-----------+ 3138 | Field Name | Field Type | Reference | 3139 +-------------------------+-----------------+-----------+ 3140 | termsOfService | string | RFC XXXX | 3141 | | | | 3142 | website | string | RFC XXXX | 3143 | | | | 3144 | caaIdentities | array of string | RFC XXXX | 3145 | | | | 3146 | externalAccountRequired | boolean | RFC XXXX | 3147 +-------------------------+-----------------+-----------+ 3149 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 3150 to this document ]] 3152 9.7.7. Identifier Types 3154 This registry lists the types of identifiers that can be present in 3155 ACME authorization objects. 3157 Template: 3159 o Label: The value to be put in the "type" field of the identifier 3160 object 3162 o Reference: Where the identifier type is defined 3164 Initial contents: 3166 +-------+-----------+ 3167 | Label | Reference | 3168 +-------+-----------+ 3169 | dns | RFC XXXX | 3170 +-------+-----------+ 3172 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 3173 to this document ]] 3175 9.7.8. Validation Methods 3177 This registry lists identifiers for the ways that CAs can validate 3178 control of identifiers. Each method's entry must specify whether it 3179 corresponds to an ACME challenge type. The "Identifier Type" field 3180 must be contained in the Label column of the ACME Identifier Types 3181 registry. 3183 Template: 3185 o Label: The identifier for this validation method 3187 o Identifier Type: The type of identifier that this method applies 3188 to 3190 o ACME: "Y" if the validation method corresponds to an ACME 3191 challenge type; "N" otherwise. 3193 o Reference: Where the validation method is defined 3195 Initial Contents 3197 +------------+-----------------+------+-----------+ 3198 | Label | Identifier Type | ACME | Reference | 3199 +------------+-----------------+------+-----------+ 3200 | http-01 | dns | Y | RFC XXXX | 3201 | | | | | 3202 | dns-01 | dns | Y | RFC XXXX | 3203 | | | | | 3204 | tls-sni-01 | RESERVED | N | RFC XXXX | 3205 | | | | | 3206 | tls-sni-02 | RESERVED | N | RFC XXXX | 3207 +------------+-----------------+------+-----------+ 3209 When evaluating a request for an assignment in this registry, the 3210 designated expert should ensure that the method being registered has 3211 a clear, interoperable definition and does not overlap with existing 3212 validation methods. That is, it should not be possible for a client 3213 and server to follow the same set of actions to fulfill two different 3214 validation methods. 3216 The values "tls-sni-01" and "tls-sni-02" are reserved because they 3217 were used in pre-RFC versions of this specification to denote 3218 validation methods that were removed because they were found not to 3219 be secure in some cases. 3221 Validation methods do not have to be compatible with ACME in order to 3222 be registered. For example, a CA might wish to register a validation 3223 method in order to support its use with the ACME extensions to CAA 3224 [I-D.ietf-acme-caa]. 3226 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 3227 to this document ]] 3229 10. Security Considerations 3231 ACME is a protocol for managing certificates that attest to 3232 identifier/key bindings. Thus the foremost security goal of ACME is 3233 to ensure the integrity of this process, i.e., to ensure that the 3234 bindings attested by certificates are correct and that only 3235 authorized entities can manage certificates. ACME identifies clients 3236 by their account keys, so this overall goal breaks down into two more 3237 precise goals: 3239 1. Only an entity that controls an identifier can get an 3240 authorization for that identifier 3242 2. Once authorized, an account key's authorizations cannot be 3243 improperly used by another account 3245 In this section, we discuss the threat model that underlies ACME and 3246 the ways that ACME achieves these security goals within that threat 3247 model. We also discuss the denial-of-service risks that ACME servers 3248 face, and a few other miscellaneous considerations. 3250 10.1. Threat Model 3252 As a service on the Internet, ACME broadly exists within the Internet 3253 threat model [RFC3552]. In analyzing ACME, it is useful to think of 3254 an ACME server interacting with other Internet hosts along two 3255 "channels": 3257 o An ACME channel, over which the ACME HTTPS requests are exchanged 3259 o A validation channel, over which the ACME server performs 3260 additional requests to validate a client's control of an 3261 identifier 3263 +------------+ 3264 | ACME | ACME Channel 3265 | Client |--------------------+ 3266 +------------+ | 3267 V 3268 +------------+ 3269 | ACME | 3270 | Server | 3271 +------------+ 3272 +------------+ | 3273 | Validation |<-------------------+ 3274 | Server | Validation Channel 3275 +------------+ 3277 Communications Channels Used by ACME 3279 In practice, the risks to these channels are not entirely separate, 3280 but they are different in most cases. Each channel, for example, 3281 uses a different communications pattern: the ACME channel will 3282 comprise inbound HTTPS connections to the ACME server and the 3283 validation channel outbound HTTP or DNS requests. 3285 Broadly speaking, ACME aims to be secure against active and passive 3286 attackers on any individual channel. Some vulnerabilities arise 3287 (noted below) when an attacker can exploit both the ACME channel and 3288 one of the others. 3290 On the ACME channel, in addition to network layer attackers, we also 3291 need to account for man-in-the-middle (MitM) attacks at the 3292 application layer, and for abusive use of the protocol itself. 3293 Protection against application layer MitM addresses potential 3294 attackers such as Content Distribution Networks (CDNs) and 3295 middleboxes with a TLS MitM function. Preventing abusive use of ACME 3296 means ensuring that an attacker with access to the validation channel 3297 can't obtain illegitimate authorization by acting as an ACME client 3298 (legitimately, in terms of the protocol). 3300 10.2. Integrity of Authorizations 3302 ACME allows anyone to request challenges for an identifier by 3303 registering an account key and sending a new-order request using that 3304 account key. The integrity of the authorization process thus depends 3305 on the identifier validation challenges to ensure that the challenge 3306 can only be completed by someone who both (1) holds the private key 3307 of the account key pair, and (2) controls the identifier in question. 3309 Validation responses need to be bound to an account key pair in order 3310 to avoid situations where a MitM on ACME HTTPS requests can switch 3311 out a legitimate domain holder's account key for one of his choosing, 3312 e.g.: 3314 o Legitimate domain holder registers account key pair A 3316 o MitM registers account key pair B 3318 o Legitimate domain holder sends a new-order request signed using 3319 account key A 3321 o MitM suppresses the legitimate request but sends the same request 3322 signed using account key B 3324 o ACME server issues challenges and MitM forwards them to the 3325 legitimate domain holder 3327 o Legitimate domain holder provisions the validation response 3329 o ACME server performs validation query and sees the response 3330 provisioned by the legitimate domain holder 3332 o Because the challenges were issued in response to a message signed 3333 account key B, the ACME server grants authorization to account key 3334 B (the MitM) instead of account key A (the legitimate domain 3335 holder) 3337 Domain ACME 3338 Holder MitM Server 3339 | | | 3340 | newAccount(A) | | 3341 |--------------------->|--------------------->| 3342 | | | 3343 | | newAccount(B) | 3344 | |--------------------->| 3345 | newOrder(domain, A) | | 3346 |--------------------->| | 3347 | | newOrder(domain, B) | 3348 | |--------------------->| 3349 | | | 3350 | authz, challenges | authz, challenges | 3351 |<---------------------|<---------------------| 3352 | | | 3353 | response(chall, A) | response(chall, B) | 3354 |--------------------->|--------------------->| 3355 | | | 3356 | validation request | | 3357 |<--------------------------------------------| 3358 | | | 3359 | validation response | | 3360 |-------------------------------------------->| 3361 | | | 3362 | | | Considers challenge 3363 | | | fulfilled by B. 3364 | | | 3366 Man-in-the-Middle Attack Exploiting a Validation Method without 3367 Account Key Binding 3369 All of the challenges above have a binding between the account 3370 private key and the validation query made by the server, via the key 3371 authorization. The key authorization reflects the account public 3372 key, is provided to the server in the validation response over the 3373 validation channel and signed afterwards by the corresponding private 3374 key in the challenge response over the ACME channel. 3376 The association of challenges to identifiers is typically done by 3377 requiring the client to perform some action that only someone who 3378 effectively controls the identifier can perform. For the challenges 3379 in this document, the actions are: 3381 o HTTP: Provision files under .well-known on a web server for the 3382 domain 3384 o DNS: Provision DNS resource records for the domain 3385 There are several ways that these assumptions can be violated, both 3386 by misconfiguration and by attacks. For example, on a web server 3387 that allows non-administrative users to write to .well-known, any 3388 user can claim to own the web server's hostname by responding to an 3389 HTTP challenge. Similarly, if a server that can be used for ACME 3390 validation is compromised by a malicious actor, then that malicious 3391 actor can use that access to obtain certificates via ACME. 3393 The use of hosting providers is a particular risk for ACME 3394 validation. If the owner of the domain has outsourced operation of 3395 DNS or web services to a hosting provider, there is nothing that can 3396 be done against tampering by the hosting provider. As far as the 3397 outside world is concerned, the zone or website provided by the 3398 hosting provider is the real thing. 3400 More limited forms of delegation can also lead to an unintended party 3401 gaining the ability to successfully complete a validation 3402 transaction. For example, suppose an ACME server follows HTTP 3403 redirects in HTTP validation and a website operator provisions a 3404 catch-all redirect rule that redirects requests for unknown resources 3405 to a different domain. Then the target of the redirect could use 3406 that to get a certificate through HTTP validation since the 3407 validation path will not be known to the primary server. 3409 The DNS is a common point of vulnerability for all of these 3410 challenges. An entity that can provision false DNS records for a 3411 domain can attack the DNS challenge directly and can provision false 3412 A/AAAA records to direct the ACME server to send its HTTP validation 3413 query to a remote server of the attacker's choosing. There are a few 3414 different mitigations that ACME servers can apply: 3416 o Always querying the DNS using a DNSSEC-validating resolver 3417 (enhancing security for zones that are DNSSEC-enabled) 3419 o Querying the DNS from multiple vantage points to address local 3420 attackers 3422 o Applying mitigations against DNS off-path attackers, e.g., adding 3423 entropy to requests [I-D.vixie-dnsext-dns0x20] or only using TCP 3425 Given these considerations, the ACME validation process makes it 3426 impossible for any attacker on the ACME channel or a passive attacker 3427 on the validation channel to hijack the authorization process to 3428 authorize a key of the attacker's choice. 3430 An attacker that can only see the ACME channel would need to convince 3431 the validation server to provide a response that would authorize the 3432 attacker's account key, but this is prevented by binding the 3433 validation response to the account key used to request challenges. A 3434 passive attacker on the validation channel can observe the correct 3435 validation response and even replay it, but that response can only be 3436 used with the account key for which it was generated. 3438 An active attacker on the validation channel can subvert the ACME 3439 process, by performing normal ACME transactions and providing a 3440 validation response for his own account key. The risks due to 3441 hosting providers noted above are a particular case. 3443 It is RECOMMENDED that the server perform DNS queries and make HTTP 3444 connections from various network perspectives, in order to make MitM 3445 attacks harder. 3447 10.3. Denial-of-Service Considerations 3449 As a protocol run over HTTPS, standard considerations for TCP-based 3450 and HTTP-based DoS mitigation also apply to ACME. 3452 At the application layer, ACME requires the server to perform a few 3453 potentially expensive operations. Identifier validation transactions 3454 require the ACME server to make outbound connections to potentially 3455 attacker-controlled servers, and certificate issuance can require 3456 interactions with cryptographic hardware. 3458 In addition, an attacker can also cause the ACME server to send 3459 validation requests to a domain of its choosing by submitting 3460 authorization requests for the victim domain. 3462 All of these attacks can be mitigated by the application of 3463 appropriate rate limits. Issues closer to the front end, like POST 3464 body validation, can be addressed using HTTP request limiting. For 3465 validation and certificate requests, there are other identifiers on 3466 which rate limits can be keyed. For example, the server might limit 3467 the rate at which any individual account key can issue certificates 3468 or the rate at which validation can be requested within a given 3469 subtree of the DNS. And in order to prevent attackers from 3470 circumventing these limits simply by minting new accounts, servers 3471 would need to limit the rate at which accounts can be registered. 3473 10.4. Server-Side Request Forgery 3475 Server-Side Request Forgery (SSRF) attacks can arise when an attacker 3476 can cause a server to perform HTTP requests to an attacker-chosen 3477 URL. In the ACME HTTP challenge validation process, the ACME server 3478 performs an HTTP GET request to a URL in which the attacker can 3479 choose the domain. This request is made before the server has 3480 verified that the client controls the domain, so any client can cause 3481 a query to any domain. 3483 Some server implementations include information from the validation 3484 server's response (in order to facilitate debugging). Such 3485 implementations enable an attacker to extract this information from 3486 any web server that is accessible to the ACME server, even if it is 3487 not accessible to the ACME client. For example, the ACME server 3488 might be able to access servers behind a firewall that would prevent 3489 access by the ACME client. 3491 It might seem that the risk of SSRF through this channel is limited 3492 by the fact that the attacker can only control the domain of the URL, 3493 not the path. However, if the attacker first sets the domain to one 3494 they control, then they can send the server an HTTP redirect (e.g., a 3495 302 response) which will cause the server to query an arbitrary URL. 3497 In order to further limit the SSRF risk, ACME server operators should 3498 ensure that validation queries can only be sent to servers on the 3499 public Internet, and not, say, web services within the server 3500 operator's internal network. Since the attacker could make requests 3501 to these public servers himself, he can't gain anything extra through 3502 an SSRF attack on ACME aside from a layer of anonymization. 3504 10.5. CA Policy Considerations 3506 The controls on issuance enabled by ACME are focused on validating 3507 that a certificate applicant controls the identifier he claims. 3508 Before issuing a certificate, however, there are many other checks 3509 that a CA might need to perform, for example: 3511 o Has the client agreed to a subscriber agreement? 3513 o Is the claimed identifier syntactically valid? 3515 o For domain names: 3517 * If the leftmost label is a '*', then have the appropriate 3518 checks been applied? 3520 * Is the name on the Public Suffix List? 3522 * Is the name a high-value name? 3524 * Is the name a known phishing domain? 3526 o Is the key in the CSR sufficiently strong? 3527 o Is the CSR signed with an acceptable algorithm? 3529 o Has issuance been authorized or forbidden by a Certificate 3530 Authority Authorization (CAA) record? [RFC6844] 3532 CAs that use ACME to automate issuance will need to ensure that their 3533 servers perform all necessary checks before issuing. 3535 CAs using ACME to allow clients to agree to terms of service should 3536 keep in mind that ACME clients can automate this agreement, possibly 3537 not involving a human user. 3539 11. Operational Considerations 3541 There are certain factors that arise in operational reality that 3542 operators of ACME-based CAs will need to keep in mind when 3543 configuring their services. For example: 3545 11.1. Key Selection 3547 ACME relies on two different classes of key pair: 3549 o Account key pairs, which are used to authenticate account holders 3551 o Certificate key pairs, which are used to sign and verify CSRs (and 3552 whose public keys are included in certificates) 3554 Compromise of the private key of an account key pair has more serious 3555 consequences than compromise of a private key corresponding to a 3556 certificate. While the compromise of a certificate key pair allows 3557 the attacker to impersonate the entities named in the certificate for 3558 the lifetime of the certificate, the compromise of an account key 3559 pair allows the attacker to take full control of the victim's ACME 3560 account, and take any action that the legitimate account holder could 3561 take within the scope of ACME: 3563 1. Issuing certificates using existing authorizations 3565 2. Revoking existing certificates 3567 3. Accessing and changing account information (e.g., contacts) 3569 4. Changing the account key pair for the account, locking out the 3570 legitimate account holder 3572 For this reason, it is RECOMMENDED that account key pairs be used for 3573 no other purpose besides ACME authentication. For example, the 3574 public key of an account key pair SHOULD NOT be included in a 3575 certificate. ACME clients and servers SHOULD verify that a CSR 3576 submitted in a finalize request does not contain a public key for any 3577 known account key pair. In particular, when a server receives a 3578 finalize request, it MUST verify that the public key in a CSR is not 3579 the same as the public key of the account key pair used to 3580 authenticate that request. This assures that vulnerabilities in the 3581 protocols with which the certificate is used (e.g., signing oracles 3582 in TLS [JSS15]) do not result in compromise of the ACME account. 3584 11.2. DNS security 3586 As noted above, DNS forgery attacks against the ACME server can 3587 result in the server making incorrect decisions about domain control 3588 and thus mis-issuing certificates. Servers SHOULD perform DNS 3589 queries over TCP, which provides better resistance to some forgery 3590 attacks than DNS over UDP. 3592 An ACME-based CA will often need to make DNS queries, e.g., to 3593 validate control of DNS names. Because the security of such 3594 validations ultimately depends on the authenticity of DNS data, every 3595 possible precaution should be taken to secure DNS queries done by the 3596 CA. It is therefore RECOMMENDED that ACME-based CAs make all DNS 3597 queries via DNSSEC-validating stub or recursive resolvers. This 3598 provides additional protection to domains which choose to make use of 3599 DNSSEC. 3601 An ACME-based CA must use only a resolver if it trusts the resolver 3602 and every component of the network route by which it is accessed. It 3603 is therefore RECOMMENDED that ACME-based CAs operate their own 3604 DNSSEC-validating resolvers within their trusted network and use 3605 these resolvers both for both CAA record lookups and all record 3606 lookups in furtherance of a challenge scheme (A, AAAA, TXT, etc.). 3608 11.3. Token Entropy 3610 The http-01, and dns-01 validation methods mandate the usage of a 3611 random token value to uniquely identify the challenge. The value of 3612 the token is required to contain at least 128 bits of entropy for the 3613 following security properties. First, the ACME client should not be 3614 able to influence the ACME server's choice of token as this may allow 3615 an attacker to reuse a domain owner's previous challenge responses 3616 for a new validation request. Secondly, the entropy requirement 3617 prevents ACME clients from implementing a "naive" validation server 3618 that automatically replies to challenges without participating in the 3619 creation of the initial authorization request. 3621 11.4. Malformed Certificate Chains 3623 ACME provides certificate chains in the widely-used format known 3624 colloquially as PEM (though it may diverge from the actual Privacy 3625 Enhanced Mail specifications [RFC1421], as noted in [RFC7468]). Some 3626 current software will allow the configuration of a private key and a 3627 certificate in one PEM file, by concatenating the textual encodings 3628 of the two objects. In the context of ACME, such software might be 3629 vulnerable to "key replacement" attacks. A malicious ACME server 3630 could cause a client to use a private key of its choosing by 3631 including the key in the PEM file returned in response to a query for 3632 a certificate URL. 3634 When processing an file of type "application/pem-certificate-chain", 3635 a client SHOULD verify that the file contains only encoded 3636 certificates. If anything other than a certificate is found (i.e., 3637 if the string "-----BEGIN" is ever followed by anything other than 3638 "CERTIFICATE"), then the client MUST reject the file as invalid. 3640 12. Acknowledgements 3642 In addition to the editors listed on the front page, this document 3643 has benefited from contributions from a broad set of contributors, 3644 all the way back to its inception. 3646 o Andrew Ayer, SSLMate 3648 o Karthik Bhargavan, INRIA 3650 o Peter Eckersley, EFF 3652 o Alex Halderman, University of Michigan 3654 o Sophie Herold, Hemio 3656 o Eric Rescorla, Mozilla 3658 o Seth Schoen, EFF 3660 o Martin Thomson, Mozilla 3662 o Jakub Warmuz, University of Oxford 3664 This document draws on many concepts established by Eric Rescorla's 3665 "Automated Certificate Issuance Protocol" draft. Martin Thomson 3666 provided helpful guidance in the use of HTTP. 3668 13. References 3670 13.1. Normative References 3672 [FIPS180-4] 3673 Department of Commerce, National., "NIST FIPS 180-4, 3674 Secure Hash Standard", March 2012, 3675 . 3678 [JSS15] Somorovsky, J., "On the Security of TLS 1.3 and QUIC 3679 Against Weaknesses in PKCS#1 v1.5 Encryption", n.d., 3680 . 3682 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 3683 Requirement Levels", BCP 14, RFC 2119, 3684 DOI 10.17487/RFC2119, March 1997, 3685 . 3687 [RFC2585] Housley, R. and P. Hoffman, "Internet X.509 Public Key 3688 Infrastructure Operational Protocols: FTP and HTTP", 3689 RFC 2585, DOI 10.17487/RFC2585, May 1999, 3690 . 3692 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, 3693 DOI 10.17487/RFC2818, May 2000, 3694 . 3696 [RFC2985] Nystrom, M. and B. Kaliski, "PKCS #9: Selected Object 3697 Classes and Attribute Types Version 2.0", RFC 2985, 3698 DOI 10.17487/RFC2985, November 2000, 3699 . 3701 [RFC2986] Nystrom, M. and B. Kaliski, "PKCS #10: Certification 3702 Request Syntax Specification Version 1.7", RFC 2986, 3703 DOI 10.17487/RFC2986, November 2000, 3704 . 3706 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 3707 Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002, 3708 . 3710 [RFC3492] Costello, A., "Punycode: A Bootstring encoding of Unicode 3711 for Internationalized Domain Names in Applications 3712 (IDNA)", RFC 3492, DOI 10.17487/RFC3492, March 2003, 3713 . 3715 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 3716 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November 3717 2003, . 3719 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 3720 Resource Identifier (URI): Generic Syntax", STD 66, 3721 RFC 3986, DOI 10.17487/RFC3986, January 2005, 3722 . 3724 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 3725 Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, 3726 . 3728 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 3729 (TLS) Protocol Version 1.2", RFC 5246, 3730 DOI 10.17487/RFC5246, August 2008, 3731 . 3733 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 3734 Housley, R., and W. Polk, "Internet X.509 Public Key 3735 Infrastructure Certificate and Certificate Revocation List 3736 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 3737 . 3739 [RFC5890] Klensin, J., "Internationalized Domain Names for 3740 Applications (IDNA): Definitions and Document Framework", 3741 RFC 5890, DOI 10.17487/RFC5890, August 2010, 3742 . 3744 [RFC5988] Nottingham, M., "Web Linking", RFC 5988, 3745 DOI 10.17487/RFC5988, October 2010, 3746 . 3748 [RFC6068] Duerst, M., Masinter, L., and J. Zawinski, "The 'mailto' 3749 URI Scheme", RFC 6068, DOI 10.17487/RFC6068, October 2010, 3750 . 3752 [RFC6570] Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., 3753 and D. Orchard, "URI Template", RFC 6570, 3754 DOI 10.17487/RFC6570, March 2012, 3755 . 3757 [RFC6844] Hallam-Baker, P. and R. Stradling, "DNS Certification 3758 Authority Authorization (CAA) Resource Record", RFC 6844, 3759 DOI 10.17487/RFC6844, January 2013, 3760 . 3762 [RFC7159] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 3763 Interchange Format", RFC 7159, DOI 10.17487/RFC7159, March 3764 2014, . 3766 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 3767 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 3768 DOI 10.17487/RFC7231, June 2014, 3769 . 3771 [RFC7468] Josefsson, S. and S. Leonard, "Textual Encodings of PKIX, 3772 PKCS, and CMS Structures", RFC 7468, DOI 10.17487/RFC7468, 3773 April 2015, . 3775 [RFC7515] Jones, M., Bradley, J., and N. Sakimura, "JSON Web 3776 Signature (JWS)", RFC 7515, DOI 10.17487/RFC7515, May 3777 2015, . 3779 [RFC7518] Jones, M., "JSON Web Algorithms (JWA)", RFC 7518, 3780 DOI 10.17487/RFC7518, May 2015, 3781 . 3783 [RFC7638] Jones, M. and N. Sakimura, "JSON Web Key (JWK) 3784 Thumbprint", RFC 7638, DOI 10.17487/RFC7638, September 3785 2015, . 3787 [RFC7797] Jones, M., "JSON Web Signature (JWS) Unencoded Payload 3788 Option", RFC 7797, DOI 10.17487/RFC7797, February 2016, 3789 . 3791 [RFC7807] Nottingham, M. and E. Wilde, "Problem Details for HTTP 3792 APIs", RFC 7807, DOI 10.17487/RFC7807, March 2016, 3793 . 3795 [RFC8037] Liusvaara, I., "CFRG Elliptic Curve Diffie-Hellman (ECDH) 3796 and Signatures in JSON Object Signing and Encryption 3797 (JOSE)", RFC 8037, DOI 10.17487/RFC8037, January 2017, 3798 . 3800 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 3801 Writing an IANA Considerations Section in RFCs", BCP 26, 3802 RFC 8126, DOI 10.17487/RFC8126, June 2017, 3803 . 3805 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 3806 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 3807 May 2017, . 3809 13.2. Informative References 3811 [I-D.ietf-acme-caa] 3812 Landau, H., "CAA Record Extensions for Account URI and 3813 ACME Method Binding", draft-ietf-acme-caa-05 (work in 3814 progress), June 2018. 3816 [I-D.ietf-acme-ip] 3817 Shoemaker, R., "ACME IP Identifier Validation Extension", 3818 draft-ietf-acme-ip-02 (work in progress), May 2018. 3820 [I-D.ietf-acme-telephone] 3821 Peterson, J. and R. Barnes, "ACME Identifiers and 3822 Challenges for Telephone Numbers", draft-ietf-acme- 3823 telephone-01 (work in progress), October 2017. 3825 [I-D.vixie-dnsext-dns0x20] 3826 Vixie, P. and D. Dagon, "Use of Bit 0x20 in DNS Labels to 3827 Improve Transaction Identity", draft-vixie-dnsext- 3828 dns0x20-00 (work in progress), March 2008. 3830 [RFC1421] Linn, J., "Privacy Enhancement for Internet Electronic 3831 Mail: Part I: Message Encryption and Authentication 3832 Procedures", RFC 1421, DOI 10.17487/RFC1421, February 3833 1993, . 3835 [RFC3552] Rescorla, E. and B. Korver, "Guidelines for Writing RFC 3836 Text on Security Considerations", BCP 72, RFC 3552, 3837 DOI 10.17487/RFC3552, July 2003, 3838 . 3840 [RFC3553] Mealling, M., Masinter, L., Hardie, T., and G. Klyne, "An 3841 IETF URN Sub-namespace for Registered Protocol 3842 Parameters", BCP 73, RFC 3553, DOI 10.17487/RFC3553, June 3843 2003, . 3845 [RFC5785] Nottingham, M. and E. Hammer-Lahav, "Defining Well-Known 3846 Uniform Resource Identifiers (URIs)", RFC 5785, 3847 DOI 10.17487/RFC5785, April 2010, 3848 . 3850 [RFC7525] Sheffer, Y., Holz, R., and P. Saint-Andre, 3851 "Recommendations for Secure Use of Transport Layer 3852 Security (TLS) and Datagram Transport Layer Security 3853 (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May 3854 2015, . 3856 [W3C.CR-cors-20130129] 3857 Kesteren, A., "Cross-Origin Resource Sharing", World Wide 3858 Web Consortium CR CR-cors-20130129, January 2013, 3859 . 3861 13.3. URIs 3863 [1] https://github.com/ietf-wg-acme/acme 3865 Authors' Addresses 3867 Richard Barnes 3868 Cisco 3870 Email: rlb@ipv.sx 3872 Jacob Hoffman-Andrews 3873 EFF 3875 Email: jsha@eff.org 3877 Daniel McCarney 3878 Let's Encrypt 3880 Email: cpu@letsencrypt.org 3882 James Kasten 3883 University of Michigan 3885 Email: jdkasten@umich.edu