idnits 2.17.1 draft-ietf-acme-acme-10.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 852 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 (March 05, 2018) is 2242 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 3663 == Missing Reference: 'A-Z' is mentioned on line 604, but not defined == Missing Reference: '0-9' is mentioned on line 604, but not defined -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS180-4' ** 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-03 == Outdated reference: A later version (-08) exists of draft-ietf-acme-ip-01 -- 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 (~~), 6 warnings (==), 7 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: September 6, 2018 EFF 6 D. McCarney 7 Let's Encrypt 8 J. Kasten 9 University of Michigan 10 March 05, 2018 12 Automatic Certificate Management Environment (ACME) 13 draft-ietf-acme-acme-10 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 September 6, 2018. 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 . . . . . . . . . . . . . . . . . . . . . . . . . 6 73 4. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 7 74 5. Character Encoding . . . . . . . . . . . . . . . . . . . . . 9 75 6. Message Transport . . . . . . . . . . . . . . . . . . . . . . 9 76 6.1. HTTPS Requests . . . . . . . . . . . . . . . . . . . . . 9 77 6.2. Request Authentication . . . . . . . . . . . . . . . . . 10 78 6.3. Request URL Integrity . . . . . . . . . . . . . . . . . . 12 79 6.3.1. "url" (URL) JWS Header Parameter . . . . . . . . . . 12 80 6.4. Replay protection . . . . . . . . . . . . . . . . . . . . 12 81 6.4.1. Replay-Nonce . . . . . . . . . . . . . . . . . . . . 13 82 6.4.2. "nonce" (Nonce) JWS Header Parameter . . . . . . . . 14 83 6.5. Rate Limits . . . . . . . . . . . . . . . . . . . . . . . 14 84 6.6. Errors . . . . . . . . . . . . . . . . . . . . . . . . . 14 85 6.6.1. Subproblems . . . . . . . . . . . . . . . . . . . . . 16 86 7. Certificate Management . . . . . . . . . . . . . . . . . . . 17 87 7.1. Resources . . . . . . . . . . . . . . . . . . . . . . . . 17 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 . . . . . . . . . . . . . . . . . . 27 93 7.1.6. Status Changes . . . . . . . . . . . . . . . . . . . 27 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 . . . . . . . . . . . . . . . . . . . 33 98 7.3.3. Account Information . . . . . . . . . . . . . . . . . 34 99 7.3.4. Changes of Terms of Service . . . . . . . . . . . . . 34 100 7.3.5. External Account Binding . . . . . . . . . . . . . . 35 101 7.3.6. Account Key Roll-over . . . . . . . . . . . . . . . . 37 102 7.3.7. Account Deactivation . . . . . . . . . . . . . . . . 39 103 7.4. Applying for Certificate Issuance . . . . . . . . . . . . 40 104 7.4.1. Pre-Authorization . . . . . . . . . . . . . . . . . . 44 105 7.4.2. Downloading the Certificate . . . . . . . . . . . . . 46 106 7.5. Identifier Authorization . . . . . . . . . . . . . . . . 47 107 7.5.1. Responding to Challenges . . . . . . . . . . . . . . 48 108 7.5.2. Deactivating an Authorization . . . . . . . . . . . . 50 109 7.6. Certificate Revocation . . . . . . . . . . . . . . . . . 51 110 8. Identifier Validation Challenges . . . . . . . . . . . . . . 53 111 8.1. Key Authorizations . . . . . . . . . . . . . . . . . . . 55 112 8.2. Retrying Challenges . . . . . . . . . . . . . . . . . . . 55 113 8.3. HTTP Challenge . . . . . . . . . . . . . . . . . . . . . 56 114 8.4. DNS Challenge . . . . . . . . . . . . . . . . . . . . . . 58 115 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 60 116 9.1. MIME Type: application/pem-certificate-chain . . . . . . 60 117 9.2. Well-Known URI for the HTTP Challenge . . . . . . . . . . 61 118 9.3. Replay-Nonce HTTP Header . . . . . . . . . . . . . . . . 61 119 9.4. "url" JWS Header Parameter . . . . . . . . . . . . . . . 61 120 9.5. "nonce" JWS Header Parameter . . . . . . . . . . . . . . 62 121 9.6. URN Sub-namespace for ACME (urn:ietf:params:acme) . . . . 62 122 9.7. New Registries . . . . . . . . . . . . . . . . . . . . . 62 123 9.7.1. Fields in Account Objects . . . . . . . . . . . . . . 63 124 9.7.2. Fields in Order Objects . . . . . . . . . . . . . . . 64 125 9.7.3. Fields in Authorization Objects . . . . . . . . . . . 65 126 9.7.4. Error Types . . . . . . . . . . . . . . . . . . . . . 66 127 9.7.5. Resource Types . . . . . . . . . . . . . . . . . . . 66 128 9.7.6. Fields in the "meta" Object within a Directory Object 67 129 9.7.7. Identifier Types . . . . . . . . . . . . . . . . . . 68 130 9.7.8. Validation Methods . . . . . . . . . . . . . . . . . 68 131 10. Security Considerations . . . . . . . . . . . . . . . . . . . 69 132 10.1. Threat Model . . . . . . . . . . . . . . . . . . . . . . 70 133 10.2. Integrity of Authorizations . . . . . . . . . . . . . . 71 134 10.3. Denial-of-Service Considerations . . . . . . . . . . . . 73 135 10.4. Server-Side Request Forgery . . . . . . . . . . . . . . 74 136 10.5. CA Policy Considerations . . . . . . . . . . . . . . . . 74 137 11. Operational Considerations . . . . . . . . . . . . . . . . . 75 138 11.1. DNS security . . . . . . . . . . . . . . . . . . . . . . 75 139 11.2. Token Entropy . . . . . . . . . . . . . . . . . . . . . 76 140 11.3. Malformed Certificate Chains . . . . . . . . . . . . . . 76 141 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 76 142 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 77 143 13.1. Normative References . . . . . . . . . . . . . . . . . . 77 144 13.2. Informative References . . . . . . . . . . . . . . . . . 80 145 13.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 81 146 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 81 148 1. Introduction 150 Certificates [RFC5280] in the Web PKI are most commonly used to 151 authenticate domain names. Thus, certificate authorities in the Web 152 PKI are trusted to verify that an applicant for a certificate 153 legitimately represents the domain name(s) in the certificate. 155 Different types of certificates reflect different kinds of CA 156 verification of information about the certificate subject. "Domain 157 Validation" (DV) certificates are by far the most common type. For 158 DV validation, the CA merely verifies that the requester has 159 effective control of the web server and/or DNS server for the domain, 160 but does not explicitly attempt to verify their real-world identity. 161 (This is as opposed to "Organization Validation" (OV) and "Extended 162 Validation" (EV) certificates, where the process is intended to also 163 verify the real-world identity of the requester.) 165 Existing Web PKI certificate authorities tend to use a set of ad hoc 166 protocols for certificate issuance and identity verification. In the 167 case of DV certificates, a typical user experience is something like: 169 o Generate a PKCS#10 [RFC2986] Certificate Signing Request (CSR). 171 o Cut-and-paste the CSR into a CA web page. 173 o Prove ownership of the domain by one of the following methods: 175 * Put a CA-provided challenge at a specific place on the web 176 server. 178 * Put a CA-provided challenge in a DNS record corresponding to 179 the target domain. 181 * Receive a CA-provided challenge at a (hopefully) administrator- 182 controlled email address corresponding to the domain and then 183 respond to it on the CA's web page. 185 o Download the issued certificate and install it on their Web 186 Server. 188 With the exception of the CSR itself and the certificates that are 189 issued, these are all completely ad hoc procedures and are 190 accomplished by getting the human user to follow interactive natural- 191 language instructions from the CA rather than by machine-implemented 192 published protocols. In many cases, the instructions are difficult 193 to follow and cause significant confusion. Informal usability tests 194 by the authors indicate that webmasters often need 1-3 hours to 195 obtain and install a certificate for a domain. Even in the best 196 case, the lack of published, standardized mechanisms presents an 197 obstacle to the wide deployment of HTTPS and other PKIX-dependent 198 systems because it inhibits mechanization of tasks related to 199 certificate issuance, deployment, and revocation. 201 This document describes an extensible framework for automating the 202 issuance and domain validation procedure, thereby allowing servers 203 and infrastructural software to obtain certificates without user 204 interaction. Use of this protocol should radically simplify the 205 deployment of HTTPS and the practicality of PKIX authentication for 206 other protocols based on Transport Layer Security (TLS) [RFC5246]. 208 It should be noted that while the focus of this document is on 209 validating domain names for purposes of issuing certificates in the 210 Web PKI, ACME supports extensions for uses with other identifiers in 211 other PKI contexts. For example, as of this writing, there is 212 ongoing work to use ACME for issuance of WebPKI certificates 213 attesting to IP addresses [I-D.ietf-acme-ip] and STIR certificates 214 attesting to telephone numbers [I-D.ietf-acme-telephone]. 216 ACME can also be used to automate some aspects of certificate 217 management even where non-automated processes are still needed. For 218 example, the external account binding feature (see Section 7.3.5) can 219 allow an ACME account to use authorizations that have been granted to 220 an external, non-ACME account. This allows ACME to address issuance 221 scenarios that cannot yet be fully automated, such as the issuance of 222 Extended Validation certificates. 224 2. Deployment Model and Operator Experience 226 The guiding use case for ACME is obtaining certificates for websites 227 (HTTPS [RFC2818]). In this case, the user's web server is intended 228 to speak for one or more domains, and the process of certificate 229 issuance is intended to verify that this web server actually speaks 230 for the domain(s). 232 DV certificate validation commonly checks claims about properties 233 related to control of a domain name - properties that can be observed 234 by the certificate issuer in an interactive process that can be 235 conducted purely online. That means that under typical 236 circumstances, all steps in the request, verification, and issuance 237 process can be represented and performed by Internet protocols with 238 no out-of-band human intervention. 240 Prior to ACME, when deploying an HTTPS server, a server operator 241 typically gets a prompt to generate a self-signed certificate. If 242 the operator were instead deploying an HTTPS server using ACME, the 243 experience would be something like this: 245 o The operator's ACME client prompts the operator for the intended 246 domain name(s) that the web server is to stand for. 248 o The ACME client presents the operator with a list of CAs from 249 which it could get a certificate. (This list will change over 250 time based on the capabilities of CAs and updates to ACME 251 configuration.) The ACME client might prompt the operator for 252 payment information at this point. 254 o The operator selects a CA. 256 o In the background, the ACME client contacts the CA and requests 257 that it issue a certificate for the intended domain name(s). 259 o The CA verifies that the client controls the requested domain 260 name(s) by having the ACME client perform some action related to 261 the domain name(s). 263 o Once the CA is satisfied, it issues the certificate and the ACME 264 client automatically downloads and installs it, potentially 265 notifying the operator via email, SMS, etc. 267 o The ACME client periodically contacts the CA to get updated 268 certificates, stapled OCSP responses, or whatever else would be 269 required to keep the web server functional and its credentials up- 270 to-date. 272 In this way, it would be nearly as easy to deploy with a CA-issued 273 certificate as with a self-signed certificate. Furthermore, the 274 maintenance of that CA-issued certificate would require minimal 275 manual intervention. Such close integration of ACME with HTTPS 276 servers allows the immediate and automated deployment of certificates 277 as they are issued, sparing the human administrator from much of the 278 time-consuming work described in the previous section. 280 3. Terminology 282 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 283 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 284 document are to be interpreted as described in RFC 2119 [RFC2119]. 286 The two main roles in ACME are "client" and "server". The ACME 287 client uses the protocol to request certificate management actions, 288 such as issuance or revocation. An ACME client may run on a web 289 server, mail server, or some other server system which requires valid 290 TLS certificates. Or, it may run on a separate server that does not 291 consume the certificate, but is authorized to respond to a CA- 292 provided challenge. The ACME server runs at a certification 293 authority, and responds to client requests, performing the requested 294 actions if the client is authorized. 296 An ACME client is represented by an "account key pair". The client 297 uses the private key of this key pair to sign all messages sent to 298 the server. The server uses the public key to verify the 299 authenticity and integrity of messages from the client. 301 4. Protocol Overview 303 ACME allows a client to request certificate management actions using 304 a set of JavaScript Object Notation (JSON) messages carried over 305 HTTPS. Issuance using ACME resembles a traditional CA's issuance 306 process, in which a user creates an account, requests a certificate, 307 and proves control of the domain(s) in that certificate in order for 308 the CA to sign the requested certificate. 310 The first phase of ACME is for the client to request an account with 311 the ACME server. The client generates an asymmetric key pair and 312 requests a new account, optionally providing contact information, 313 agreeing to terms of service, and/or associating the account with an 314 existing account in another system. The creation request is signed 315 with the generated private key to prove that the client controls it. 317 Client Server 319 Contact Information 320 ToS Agreement 321 Additional Data 322 Signature -------> 324 <------- Account 326 Once an account is registered, there are four major steps the client 327 needs to take to get a certificate: 329 1. Submit an order for a certificate to be issued 331 2. Prove control of any identifiers requested in the certificate 333 3. Finalize the order by submitting a CSR 335 4. Await issuance and download the issued certificate 336 The client's order for a certificate describes the desired 337 identifiers plus a few additional fields that capture semantics that 338 are not supported in the CSR format. If the server is willing to 339 consider issuing such a certificate, it responds with a list of 340 requirements that the client must satisfy before the certificate will 341 be issued. 343 For example, in most cases, the server will require the client to 344 demonstrate that it controls the identifiers in the requested 345 certificate. Because there are many different ways to validate 346 possession of different types of identifiers, the server will choose 347 from an extensible set of challenges that are appropriate for the 348 identifier being claimed. The client responds with a set of 349 responses that tell the server which challenges the client has 350 completed. The server then validates that the client has completed 351 the challenges. 353 Once the validation process is complete and the server is satisfied 354 that the client has met its requirements, the client finalizes the 355 order by submitting a PKCS#10 Certificate Signing Request (CSR). The 356 server will issue the requested certificate and make it available to 357 the client. 359 Client Server 361 Order 362 Signature -------> 363 <------- Required Authorizations 365 Responses 366 Signature -------> 368 <~~~~~~~~Validation~~~~~~~~> 370 CSR 371 Signature -------> 373 <~~~~~~Await issuance~~~~~~> 375 <------- Certificate 377 To revoke a certificate, the client sends a signed revocation request 378 indicating the certificate to be revoked: 380 Client Server 382 Revocation request 383 Signature --------> 385 <-------- Result 387 Note that while ACME is defined with enough flexibility to handle 388 different types of identifiers in principle, the primary use case 389 addressed by this document is the case where domain names are used as 390 identifiers. For example, all of the identifier validation 391 challenges described in Section 8 below address validation of domain 392 names. The use of ACME for other identifiers will require further 393 specification in order to describe how these identifiers are encoded 394 in the protocol and what types of validation challenges the server 395 might require. 397 5. Character Encoding 399 All requests and responses sent via HTTP by ACME clients, ACME 400 servers, and validation servers as well as any inputs for digest 401 computations MUST be encoded using the UTF-8 [RFC3629] character set. 403 6. Message Transport 405 Communications between an ACME client and an ACME server are done 406 over HTTPS, using JSON Web Signature (JWS) [RFC7515] to provide some 407 additional security properties for messages sent from the client to 408 the server. HTTPS provides server authentication and 409 confidentiality. With some ACME-specific extensions, JWS provides 410 authentication of the client's request payloads, anti-replay 411 protection, and integrity for the HTTPS request URL. 413 6.1. HTTPS Requests 415 Each ACME function is accomplished by the client sending a sequence 416 of HTTPS requests to the server, carrying JSON messages 417 [RFC2818][RFC7159]. Use of HTTPS is REQUIRED. Each subsection of 418 Section 7 below describes the message formats used by the function 419 and the order in which messages are sent. 421 In most HTTPS transactions used by ACME, the ACME client is the HTTPS 422 client and the ACME server is the HTTPS server. The ACME server acts 423 as an HTTP and HTTPS client when validating challenges via HTTP. 425 ACME servers SHOULD follow the recommendations of [RFC7525] when 426 configuring their TLS implementations. ACME servers that support TLS 427 1.3 MAY allow clients to send early data (0-RTT). This is safe 428 because the ACME protocol itself includes anti-replay protections 429 (see Section 6.4). 431 ACME clients SHOULD send a User-Agent header in accordance with 432 [RFC7231], including the name and version of the ACME software in 433 addition to the name and version of the underlying HTTP client 434 software. 436 ACME clients SHOULD send an Accept-Language header in accordance with 437 [RFC7231] to enable localization of error messages. 439 ACME servers that are intended to be generally accessible need to use 440 Cross-Origin Resource Sharing (CORS) in order to be accessible from 441 browser-based clients [W3C.CR-cors-20130129]. Such servers SHOULD 442 set the Access-Control-Allow-Origin header field to the value "*". 444 Binary fields in the JSON objects used by ACME are encoded using 445 base64url encoding described in [RFC4648] Section 5, according to the 446 profile specified in JSON Web Signature [RFC7515] Section 2. This 447 encoding uses a URL safe character set. Trailing '=' characters MUST 448 be stripped. 450 6.2. Request Authentication 452 All ACME requests with a non-empty body MUST encapsulate their 453 payload in a JSON Web Signature (JWS) [RFC7515] object, signed using 454 the account's private key unless otherwise specified. The server 455 MUST verify the JWS before processing the request. Encapsulating 456 request bodies in JWS provides authentication of requests. 458 JWS objects sent in ACME requests MUST meet the following additional 459 criteria: 461 o The JWS MUST be in the Flattened JSON Serialization [RFC7515] 463 o The JWS MUST NOT have the value "none" in its "alg" field 465 o The JWS MUST NOT have multiple signatures 467 o The JWS Unencoded Payload Option [RFC7797] MUST NOT be used 469 o The JWS Unprotected Header [RFC7515] MUST NOT be used 471 o The JWS MUST NOT have a Message Authentication Code (MAC)-based 472 algorithm in its "alg" field 474 o The JWS The JWS Payload MUST NOT be detached 475 o The JWS Protected Header MUST include the following fields: 477 * "alg" (Algorithm) 479 * "jwk" (JSON Web Key, for all requests not signed using an 480 existing account, e.g. newAccount) 482 * "kid" (Key ID, for all requests signed using an existing 483 account) 485 * "nonce" (defined in Section 6.4 below) 487 * "url" (defined in Section 6.3 below) 489 The "jwk" and "kid" fields are mutually exclusive. Servers MUST 490 reject requests that contain both. 492 For newAccount requests, and for revokeCert requests authenticated by 493 certificate key, there MUST be a "jwk" field. This field MUST 494 contain the public key corresponding to the private key used to sign 495 the JWS. 497 For all other requests, the request is signed using an existing 498 account and there MUST be a "kid" field. This field MUST contain the 499 account URL received by POSTing to the newAccount resource. 501 Note that authentication via signed JWS request bodies implies that 502 GET requests are not authenticated. Servers MUST NOT respond to GET 503 requests for resources that might be considered sensitive. Account 504 resources are the only sensitive resources defined in this 505 specification. 507 If the client sends a JWS signed with an algorithm that the server 508 does not support, then the server MUST return an error with status 509 code 400 (Bad Request) and type 510 "urn:ietf:params:acme:error:badSignatureAlgorithm". The problem 511 document returned with the error MUST include an "algorithms" field 512 with an array of supported "alg" values. 514 Because client requests in ACME carry JWS objects in the Flattened 515 JSON Serialization, they must have the "Content-Type" header field 516 set to "application/jose+json". If a request does not meet this 517 requirement, then the server MUST return a response with status code 518 415 (Unsupported Media Type). 520 6.3. Request URL Integrity 522 It is common in deployment for the entity terminating TLS for HTTPS 523 to be different from the entity operating the logical HTTPS server, 524 with a "request routing" layer in the middle. For example, an ACME 525 CA might have a content delivery network terminate TLS connections 526 from clients so that it can inspect client requests for denial-of- 527 service protection. 529 These intermediaries can also change values in the request that are 530 not signed in the HTTPS request, e.g., the request URL and headers. 531 ACME uses JWS to provide an integrity mechanism, which protects 532 against an intermediary changing the request URL to another ACME URL. 534 As noted in Section 6.2 above, all ACME request objects carry a "url" 535 header parameter in their protected header. This header parameter 536 encodes the URL to which the client is directing the request. On 537 receiving such an object in an HTTP request, the server MUST compare 538 the "url" header parameter to the request URL. If the two do not 539 match, then the server MUST reject the request as unauthorized. 541 Except for the directory resource, all ACME resources are addressed 542 with URLs provided to the client by the server. In requests sent to 543 these resources, the client MUST set the "url" header parameter to 544 the exact string provided by the server (rather than performing any 545 re-encoding on the URL). The server SHOULD perform the corresponding 546 string equality check, configuring each resource with the URL string 547 provided to clients and having the resource check that requests have 548 the same string in their "url" header parameter. 550 6.3.1. "url" (URL) JWS Header Parameter 552 The "url" header parameter specifies the URL [RFC3986] to which this 553 JWS object is directed. The "url" header parameter MUST be carried 554 in the protected header of the JWS. The value of the "url" header 555 parameter MUST be a string representing the URL. 557 6.4. Replay protection 559 In order to protect ACME resources from any possible replay attacks, 560 ACME requests have a mandatory anti-replay mechanism. This mechanism 561 is based on the server maintaining a list of nonces that it has 562 issued to clients, and requiring any signed request from the client 563 to carry such a nonce. 565 An ACME server provides nonces to clients using the Replay-Nonce 566 header field, as specified in Section 6.4.1 below. The server MUST 567 include a Replay-Nonce header field in every successful response to a 568 POST request and SHOULD provide it in error responses as well. 570 Every JWS sent by an ACME client MUST include, in its protected 571 header, the "nonce" header parameter, with contents as defined in 572 Section 6.4.2 below. As part of JWS verification, the ACME server 573 MUST verify that the value of the "nonce" header is a value that the 574 server previously provided in a Replay-Nonce header field. Once a 575 nonce value has appeared in an ACME request, the server MUST consider 576 it invalid, in the same way as a value it had never issued. 578 When a server rejects a request because its nonce value was 579 unacceptable (or not present), it MUST provide HTTP status code 400 580 (Bad Request), and indicate the ACME error type 581 "urn:ietf:params:acme:error:badNonce". An error response with the 582 "badNonce" error type MUST include a Replay-Nonce header with a fresh 583 nonce. On receiving such a response, a client SHOULD retry the 584 request using the new nonce. 586 The precise method used to generate and track nonces is up to the 587 server. For example, the server could generate a random 128-bit 588 value for each response, keep a list of issued nonces, and strike 589 nonces from this list as they are used. 591 6.4.1. Replay-Nonce 593 The "Replay-Nonce" header field includes a server-generated value 594 that the server can use to detect unauthorized replay in future 595 client requests. The server MUST generate the value provided in 596 Replay-Nonce in such a way that they are unique to each message, with 597 high probability. For instance, it is acceptable to generate Replay- 598 Nonces randomly. 600 The value of the Replay-Nonce field MUST be an octet string encoded 601 according to the base64url encoding described in Section 2 of 602 [RFC7515]. Clients MUST ignore invalid Replay-Nonce values. 604 base64url = [A-Z] / [a-z] / [0-9] / "-" / "_" 606 Replay-Nonce = *base64url 608 The Replay-Nonce header field SHOULD NOT be included in HTTP request 609 messages. 611 6.4.2. "nonce" (Nonce) JWS Header Parameter 613 The "nonce" header parameter provides a unique value that enables the 614 verifier of a JWS to recognize when replay has occurred. The "nonce" 615 header parameter MUST be carried in the protected header of the JWS. 617 The value of the "nonce" header parameter MUST be an octet string, 618 encoded according to the base64url encoding described in Section 2 of 619 [RFC7515]. If the value of a "nonce" header parameter is not valid 620 according to this encoding, then the verifier MUST reject the JWS as 621 malformed. 623 6.5. Rate Limits 625 Creation of resources can be rate limited by ACME servers to ensure 626 fair usage and prevent abuse. Once the rate limit is exceeded, the 627 server MUST respond with an error with the type 628 "urn:ietf:params:acme:error:rateLimited". Additionally, the server 629 SHOULD send a "Retry-After" header indicating when the current 630 request may succeed again. If multiple rate limits are in place, 631 that is the time where all rate limits allow access again for the 632 current request with exactly the same parameters. 634 In addition to the human-readable "detail" field of the error 635 response, the server MAY send one or multiple link relations in the 636 "Link" header pointing to documentation about the specific rate limit 637 that was hit, using the "help" link relation type. 639 6.6. Errors 641 Errors can be reported in ACME both at the HTTP layer and within 642 challenge objects as defined in Section 8. ACME servers can return 643 responses with an HTTP error response code (4XX or 5XX). For 644 example: If the client submits a request using a method not allowed 645 in this document, then the server MAY return status code 405 (Method 646 Not Allowed). 648 When the server responds with an error status, it SHOULD provide 649 additional information using a problem document [RFC7807]. To 650 facilitate automatic response to errors, this document defines the 651 following standard tokens for use in the "type" field (within the 652 "urn:ietf:params:acme:error:" namespace): 654 +-------------------------+-----------------------------------------+ 655 | Type | Description | 656 +-------------------------+-----------------------------------------+ 657 | badCSR | The CSR is unacceptable (e.g., due to a | 658 | | short key) | 659 | | | 660 | badNonce | The client sent an unacceptable anti- | 661 | | replay nonce | 662 | | | 663 | badSignatureAlgorithm | The JWS was signed with an algorithm | 664 | | the server does not support | 665 | | | 666 | invalidContact | A contact URL for an account was | 667 | | invalid | 668 | | | 669 | unsupportedContact | A contact URL for an account used an | 670 | | unsupported protocol scheme | 671 | | | 672 | externalAccountRequired | The request must include a value for | 673 | | the "externalAccountBinding" field | 674 | | | 675 | accountDoesNotExist | The request specified an account that | 676 | | does not exist | 677 | | | 678 | malformed | The request message was malformed | 679 | | | 680 | rateLimited | The request exceeds a rate limit | 681 | | | 682 | rejectedIdentifier | The server will not issue for the | 683 | | identifier | 684 | | | 685 | serverInternal | The server experienced an internal | 686 | | error | 687 | | | 688 | unauthorized | The client lacks sufficient | 689 | | authorization | 690 | | | 691 | unsupportedIdentifier | Identifier is not supported, but may be | 692 | | in future | 693 | | | 694 | userActionRequired | Visit the "instance" URL and take | 695 | | actions specified there | 696 | | | 697 | badRevocationReason | The revocation reason provided is not | 698 | | allowed by the server | 699 | | | 700 | caa | Certification Authority Authorization | 701 | | (CAA) records forbid the CA from | 702 | | issuing | 703 | | | 704 | dns | There was a problem with a DNS query | 705 | | | 706 | connection | The server could not connect to | 707 | | validation target | 708 | | | 709 | tls | The server received a TLS error during | 710 | | validation | 711 | | | 712 | incorrectResponse | Response received didn't match the | 713 | | challenge's requirements | 714 +-------------------------+-----------------------------------------+ 716 This list is not exhaustive. The server MAY return errors whose 717 "type" field is set to a URI other than those defined above. Servers 718 MUST NOT use the ACME URN [RFC3553] namespace for errors other than 719 the standard types. Clients SHOULD display the "detail" field of all 720 errors. 722 In the remainder of this document, we use the tokens in the table 723 above to refer to error types, rather than the full URNs. For 724 example, an "error of type 'badCSR'" refers to an error document with 725 "type" value "urn:ietf:params:acme:error:badCSR". 727 6.6.1. Subproblems 729 Sometimes a CA may need to return multiple errors in response to a 730 request. Additionally, the CA may need to attribute errors to 731 specific identifiers. For instance, a new-order request may contain 732 multiple identifiers for which the CA cannot issue. In this 733 situation, an ACME problem document MAY contain the "subproblems" 734 field, containing a JSON array of problem documents, each of which 735 MAY contain an "identifier" field. If present, the "identifier" 736 field MUST contain an ACME identifier (Section 9.7.7). The 737 "identifier" field MUST NOT be present at the top level in ACME 738 problem documents. It can only be present in subproblems. 739 Subproblems need not all have the same type, and do not need to match 740 the top level type. 742 ACME clients may choose to use the "identifier" field of a subproblem 743 as a hint that an operation would succeed if that identifier were 744 omitted. For instance, if an order contains ten DNS identifiers, and 745 the new-order request returns a problem document with two 746 subproblems, referencing two of those identifiers, the ACME client 747 may choose to submit another order containing only the eight 748 identifiers not listed in the problem document. 750 HTTP/1.1 403 Forbidden 751 Content-Type: application/problem+json 753 { 754 "type": "urn:ietf:params:acme:error:malformed", 755 "detail": "Some of the identifiers requested were rejected", 756 "subproblems": [ 757 { 758 "type": "urn:ietf:params:acme:error:malformed", 759 "detail": "Invalid underscore in DNS name \"_example.com\"", 760 "identifier": { 761 "type": "dns", 762 "value": "_example.com" 763 } 764 }, 765 { 766 "type": "urn:ietf:params:acme:error:rejectedIdentifier", 767 "detail": "This CA will not issue for \"example.net\"", 768 "identifier": { 769 "type": "dns", 770 "value": "example.net" 771 } 772 } 773 ] 774 } 776 7. Certificate Management 778 In this section, we describe the certificate management functions 779 that ACME enables: 781 o Account Creation 783 o Ordering a Certificate 785 o Identifier Authorization 787 o Certificate Issuance 789 o Certificate Revocation 791 7.1. Resources 793 ACME is structured as a REST application with the following types of 794 resources: 796 o Account resources, representing information about an account 797 (Section 7.1.2, Section 7.3) 799 o Order resources, representing an account's requests to issue 800 certificates (Section 7.1.3) 802 o Authorization resources, representing an account's authorization 803 to act for an identifier (Section 7.1.4) 805 o Challenge resources, representing a challenge to prove control of 806 an identifier (Section 7.5, Section 8) 808 o Certificate resources, representing issued certificates 809 (Section 7.4.2) 811 o A "directory" resource (Section 7.1.1) 813 o A "newNonce" resource (Section 7.2) 815 o A "newAccount" resource (Section 7.3) 817 o A "newOrder" resource (Section 7.4) 819 o A "revokeCert" resource (Section 7.6) 821 o A "keyChange" resource (Section 7.3.6) 823 The server MUST provide "directory" and "newNonce" resources. 825 ACME uses different URLs for different management functions. Each 826 function is listed in a directory along with its corresponding URL, 827 so clients only need to be configured with the directory URL. These 828 URLs are connected by a few different link relations [RFC5988]. 830 The "up" link relation is used with challenge resources to indicate 831 the authorization resource to which a challenge belongs. It is also 832 used from certificate resources to indicate a resource from which the 833 client may fetch a chain of CA certificates that could be used to 834 validate the certificate in the original resource. 836 The "index" link relation is present on all resources other than the 837 directory and indicates the URL of the directory. 839 The following diagram illustrates the relations between resources on 840 an ACME server. For the most part, these relations are expressed by 841 URLs provided as strings in the resources' JSON representations. 842 Lines with labels in quotes indicate HTTP link relations. 844 directory 845 | 846 +--> newNonce 847 | 848 +----------+----------+-----+-----+------------+ 849 | | | | | 850 | | | | | 851 V V V V V 852 newAccount newAuthz newOrder revokeCert keyChange 853 | | | 854 | | | 855 V | V 856 account | order -----> finalize 857 | | -----> cert 858 | | 859 | V 860 +---> authorizations 861 | ^ 862 | | "up" 863 V | 864 challenge 866 The following table illustrates a typical sequence of requests 867 required to establish a new account with the server, prove control of 868 an identifier, issue a certificate, and fetch an updated certificate 869 some time after issuance. The "->" is a mnemonic for a Location 870 header pointing to a created resource. 872 +-----------------------+--------------------------+----------------+ 873 | Action | Request | Response | 874 +-----------------------+--------------------------+----------------+ 875 | Get directory | GET directory | 200 | 876 | | | | 877 | Get nonce | HEAD newNonce | 200 | 878 | | | | 879 | Create account | POST newAccount | 201 -> account | 880 | | | | 881 | Submit order | POST newOrder | 201 -> order | 882 | | | | 883 | Fetch challenges | GET order | 200 | 884 | | authorizations | | 885 | | | | 886 | Respond to challenges | POST challenge urls | 200 | 887 | | | | 888 | Finalize order | POST order finalize | 200 | 889 | | | | 890 | Poll for status | GET order | 200 | 891 | | | | 892 | Download certificate | GET order cert | 200 | 893 +-----------------------+--------------------------+----------------+ 895 The remainder of this section provides the details of how these 896 resources are structured and how the ACME protocol makes use of them. 898 7.1.1. Directory 900 In order to help clients configure themselves with the right URLs for 901 each ACME operation, ACME servers provide a directory object. This 902 should be the only URL needed to configure clients. It is a JSON 903 object, whose field names are drawn from the following table and 904 whose values are the corresponding URLs. 906 +------------+--------------------+ 907 | Field | URL in value | 908 +------------+--------------------+ 909 | newNonce | New nonce | 910 | | | 911 | newAccount | New account | 912 | | | 913 | newOrder | New order | 914 | | | 915 | newAuthz | New authorization | 916 | | | 917 | revokeCert | Revoke certificate | 918 | | | 919 | keyChange | Key change | 920 +------------+--------------------+ 922 There is no constraint on the URL of the directory except that it 923 should be different from the other ACME server resources' URLs, and 924 that it should not clash with other services. For instance: 926 o a host which functions as both an ACME and a Web server may want 927 to keep the root path "/" for an HTML "front page", and place the 928 ACME directory under the path "/acme". 930 o a host which only functions as an ACME server could place the 931 directory under the path "/". 933 If the ACME server does not implement pre-authorization 934 (Section 7.4.1) it MUST omit the "newAuthz" field of the directory. 936 The object MAY additionally contain a field "meta". If present, it 937 MUST be a JSON object; each field in the object is an item of 938 metadata relating to the service provided by the ACME server. 940 The following metadata items are defined, all of which are OPTIONAL: 942 termsOfService (optional, string): A URL identifying the current 943 terms of service. 945 website (optional, string): An HTTP or HTTPS URL locating a website 946 providing more information about the ACME server. 948 caaIdentities (optional, array of string): Each string MUST be a 949 lowercase hostname which the ACME server recognizes as referring 950 to itself for the purposes of CAA record validation as defined in 951 [RFC6844]. This allows clients to determine the correct issuer 952 domain name to use when configuring CAA records. 954 externalAccountRequired (optional, boolean): If this field is 955 present and set to "true", then the CA requires that all new- 956 account requests include an "externalAccountBinding" field 957 associating the new account with an external account. 959 Clients access the directory by sending a GET request to the 960 directory URL. 962 HTTP/1.1 200 OK 963 Content-Type: application/json 965 { 966 "newNonce": "https://example.com/acme/new-nonce", 967 "newAccount": "https://example.com/acme/new-account", 968 "newOrder": "https://example.com/acme/new-order", 969 "newAuthz": "https://example.com/acme/new-authz", 970 "revokeCert": "https://example.com/acme/revoke-cert", 971 "keyChange": "https://example.com/acme/key-change", 972 "meta": { 973 "termsOfService": "https://example.com/acme/terms/2017-5-30", 974 "website": "https://www.example.com/", 975 "caaIdentities": ["example.com"], 976 "externalAccountRequired": false 977 } 978 } 980 7.1.2. Account Objects 982 An ACME account resource represents a set of metadata associated with 983 an account. Account resources have the following structure: 985 status (required, string): The status of this account. Possible 986 values are: "valid", "deactivated", and "revoked". The value 987 "deactivated" should be used to indicate client-initiated 988 deactivation whereas "revoked" should be used to indicate server- 989 initiated deactivation. 991 contact (optional, array of string): An array of URLs that the 992 server can use to contact the client for issues related to this 993 account. For example, the server may wish to notify the client 994 about server-initiated revocation or certificate expiration. 996 termsOfServiceAgreed (optional, boolean): Including this field in a 997 new-account request, with a value of true, indicates the client's 998 agreement with the terms of service. This field is not updateable 999 by the client. 1001 orders (required, string): A URL from which a list of orders 1002 submitted by this account can be fetched via a GET request, as 1003 described in Section 7.1.2.1. 1005 { 1006 "status": "valid", 1007 "contact": [ 1008 "mailto:cert-admin@example.com", 1009 "mailto:admin@example.com" 1010 ], 1011 "termsOfServiceAgreed": true, 1012 "orders": "https://example.com/acme/acct/1/orders" 1013 } 1015 7.1.2.1. Orders List 1017 Each account object includes an "orders" URL from which a list of 1018 orders created by the account can be fetched via GET request. The 1019 result of the GET request MUST be a JSON object whose "orders" field 1020 is an array of URLs, each identifying an order belonging to the 1021 account. The server SHOULD include pending orders, and SHOULD NOT 1022 include orders that are invalid in the array of URLs. The server MAY 1023 return an incomplete list, along with a Link header with a "next" 1024 link relation indicating where further entries can be acquired. 1026 HTTP/1.1 200 OK 1027 Content-Type: application/json 1028 Link: , rel="next" 1030 { 1031 "orders": [ 1032 "https://example.com/acme/acct/1/order/1", 1033 "https://example.com/acme/acct/1/order/2", 1034 /* 47 more URLs not shown for example brevity */ 1035 "https://example.com/acme/acct/1/order/50" 1036 ] 1037 } 1039 7.1.3. Order Objects 1041 An ACME order object represents a client's request for a certificate 1042 and is used to track the progress of that order through to issuance. 1043 Thus, the object contains information about the requested 1044 certificate, the authorizations that the server requires the client 1045 to complete, and any certificates that have resulted from this order. 1047 status (required, string): The status of this order. Possible 1048 values are: "pending", "ready", "processing", "valid", and 1049 "invalid". 1051 expires (optional, string): The timestamp after which the server 1052 will consider this order invalid, encoded in the format specified 1053 in RFC 3339 [RFC3339]. This field is REQUIRED for objects with 1054 "pending" or "valid" in the status field. 1056 identifiers (required, array of object): An array of identifier 1057 objects that the order pertains to. 1059 type (required, string): The type of identifier. 1061 value (required, string): The identifier itself. 1063 notBefore (optional, string): The requested value of the notBefore 1064 field in the certificate, in the date format defined in [RFC3339]. 1066 notAfter (optional, string): The requested value of the notAfter 1067 field in the certificate, in the date format defined in [RFC3339]. 1069 error (optional, object): The error that occurred while processing 1070 the order, if any. This field is structured as a problem document 1071 [RFC7807]. 1073 authorizations (required, array of string): For pending orders, the 1074 authorizations that the client needs to complete before the 1075 requested certificate can be issued (see Section 7.5). For final 1076 orders (in the "valid" or "invalid" state), the authorizations 1077 that were completed. Each entry is a URL from which an 1078 authorization can be fetched with a GET request. 1080 finalize (required, string): A URL that a CSR must be POSTed to once 1081 all of the order's authorizations are satisfied to finalize the 1082 order. The result of a successful finalization will be the 1083 population of the certificate URL for the order. 1085 certificate (optional, string): A URL for the certificate that has 1086 been issued in response to this order. 1088 { 1089 "status": "valid", 1090 "expires": "2015-03-01T14:09:00Z", 1092 "identifiers": [ 1093 { "type": "dns", "value": "example.com" }, 1094 { "type": "dns", "value": "www.example.com" } 1095 ], 1097 "notBefore": "2016-01-01T00:00:00Z", 1098 "notAfter": "2016-01-08T00:00:00Z", 1100 "authorizations": [ 1101 "https://example.com/acme/authz/1234", 1102 "https://example.com/acme/authz/2345" 1103 ], 1105 "finalize": "https://example.com/acme/acct/1/order/1/finalize", 1107 "certificate": "https://example.com/acme/cert/1234" 1108 } 1110 Any identifier of type "dns" in a new-order request MAY have a 1111 wildcard domain name as its value. A wildcard domain name consists 1112 of a single asterisk character followed by a single full stop 1113 character ("*.") followed by a domain name as defined for use in the 1114 Subject Alternate Name Extension by RFC 5280 [RFC5280]. An 1115 authorization returned by the server for a wildcard domain name 1116 identifier MUST NOT include the asterisk and full stop ("*.") prefix 1117 in the authorization identifier value. The returned authorization 1118 MUST include the optional "wildcard" field, with a value of true. 1120 The elements of the "authorizations" and "identifiers" array are 1121 immutable once set. The server MUST NOT change the contents of 1122 either array after they are created. If a client observes a change 1123 in the contents of either array, then it SHOULD consider the order 1124 invalid. 1126 The "authorizations" array of the order SHOULD reflect all 1127 authorizations that the CA takes into account in deciding to issue, 1128 even if some authorizations were fulfilled in earlier orders or in 1129 pre-authorization transactions. For example, if a CA allows multiple 1130 orders to be fulfilled based on a single authorization transaction, 1131 then it SHOULD reflect that authorization in all of the orders. 1133 7.1.4. Authorization Objects 1135 An ACME authorization object represents a server's authorization for 1136 an account to represent an identifier. In addition to the 1137 identifier, an authorization includes several metadata fields, such 1138 as the status of the authorization (e.g., "pending", "valid", or 1139 "revoked") and which challenges were used to validate possession of 1140 the identifier. 1142 The structure of an ACME authorization resource is as follows: 1144 identifier (required, object): The identifier that the account is 1145 authorized to represent 1147 type (required, string): The type of identifier. 1149 value (required, string): The identifier itself. 1151 status (required, string): The status of this authorization. 1152 Possible values are: "pending", "valid", "invalid", "deactivated", 1153 and "revoked". 1155 expires (optional, string): The timestamp after which the server 1156 will consider this authorization invalid, encoded in the format 1157 specified in RFC 3339 [RFC3339]. This field is REQUIRED for 1158 objects with "valid" in the "status" field. 1160 challenges (required, array of objects): For pending authorizations, 1161 the challenges that the client can fulfill in order to prove 1162 possession of the identifier. For final authorizations (in the 1163 "valid" or "invalid" state), the challenges that were used. Each 1164 array entry is an object with parameters required to validate the 1165 challenge. A client should attempt to fulfill one of these 1166 challenges, and a server should consider any one of the challenges 1167 sufficient to make the authorization valid. For final 1168 authorizations, it contains the challenges that were successfully 1169 completed. 1171 wildcard (optional, boolean): For authorizations created as a result 1172 of a newOrder request containing a DNS identifier with a value 1173 that contained a wildcard prefix this field MUST be present, and 1174 true. 1176 The only type of identifier defined by this specification is a fully- 1177 qualified domain name (type: "dns"). If a domain name contains non- 1178 ASCII Unicode characters it MUST be encoded using the rules defined 1179 in [RFC3492]. Servers MUST verify any identifier values that begin 1180 with the ASCII Compatible Encoding prefix "xn--" as defined in 1182 [RFC5890] are properly encoded. Wildcard domain names (with "*" as 1183 the first label) MUST NOT be included in authorization objects. If 1184 an authorization object conveys authorization for the base domain of 1185 a newOrder DNS type identifier with a wildcard prefix then the 1186 optional authorizations "wildcard" field MUST be present with a value 1187 of true. 1189 Section 8 describes a set of challenges for domain name validation. 1191 { 1192 "status": "valid", 1193 "expires": "2015-03-01T14:09:00Z", 1195 "identifier": { 1196 "type": "dns", 1197 "value": "example.org" 1198 }, 1200 "challenges": [ 1201 { 1202 "url": "https://example.com/acme/authz/1234/0", 1203 "type": "http-01", 1204 "status": "valid", 1205 "token": "DGyRejmCefe7v4NfDGDKfA", 1206 "validated": "2014-12-01T12:05:00Z" 1207 } 1208 ], 1210 "wildcard": false 1211 } 1213 7.1.5. Challenge Objects 1215 An ACME challenge object represents a server's offer to validate a 1216 client's possession of an identifier in a specific way. Unlike the 1217 other objects listed above, there is not a single standard structure 1218 for a challenge object. The contents of a challenge object depend on 1219 the validation method being used. The general structure of challenge 1220 objects and an initial set of validation methods are described in 1221 Section 8. 1223 7.1.6. Status Changes 1225 Each ACME object type goes through a simple state machine over its 1226 lifetime. The "status" field of the object indicates which state the 1227 object is currently in. 1229 Challenge objects are created in the "pending" state. They 1230 transition to the "processing" state when the client responds to the 1231 challenge (see Section 7.5.1) and the server begins attempting to 1232 validate that the client has completed the challenge. Note that 1233 within the "processing" state, the server may attempt to validate the 1234 challenge multiple times (see Section 8.2). Likewise, client 1235 requests for retries do not cause a state change. If validation is 1236 successful, the challenge moves to the "valid" state; if there is an 1237 error, the challenge moves to the "invalid" state. 1239 pending 1240 | 1241 | Receive 1242 | response 1243 V 1244 processing <-+ 1245 | | | Server retry or 1246 | | | client retry request 1247 | +----+ 1248 | 1249 | 1250 Successful | Failed 1251 validation | validation 1252 +---------+---------+ 1253 | | 1254 V V 1255 valid invalid 1257 Authorization objects are created in the "pending" state. If one of 1258 the challenges listed in the authorization transitions to the "valid" 1259 state, then the authorization also changes to the "valid" state. If 1260 there is an error while the authorization is still pending, then the 1261 authorization transitions to the "invalid" state. Once the 1262 authorization is in the valid state, it can expire ("expired"), be 1263 deactivated by the client ("deactivated", see Section 7.5.2), or 1264 revoked by the server ("revoked"). 1266 pending --------------------+ 1267 | | 1268 | | 1269 Error | Challenge valid | 1270 +---------+---------+ | 1271 | | | 1272 V V | 1273 invalid valid | 1274 | | 1275 | | 1276 | | 1277 +--------------+--------------+ 1278 | | | 1279 | | | 1280 Server | Client | Time after | 1281 revoke | deactivate | "expires" | 1282 V V V 1283 revoked deactivated expired 1285 Order objects are created in the "pending" state. Once all of the 1286 authorizations listed in the order object are in the "valid" state, 1287 the order transitions to the "ready" state. The order moves to the 1288 "processing" state after the client submits a request to the order's 1289 "finalize" URL and the CA begins the issuance process for the 1290 certificate. Once the certificate is issued, the order enters the 1291 "valid" state. If an error occurs at any of these stages, the order 1292 moves to the "invalid" state. The order also moves to the "invalid" 1293 state if it expires, or one of its authorizations enters a final 1294 state other than "valid" ("expired", "revoked", "deactivated"). 1296 pending --------------+ 1297 | | 1298 | All authz | 1299 | "valid" | 1300 V | 1301 ready ---------------+ 1302 | | 1303 | Receive | 1304 | finalize | 1305 | request | 1306 V | 1307 processing ------------+ 1308 | | 1309 | Certificate | Error or 1310 | issued | Authorization failure 1311 V V 1312 valid invalid 1314 Account objects are created in the "valid" state, since no further 1315 action is required to create an account after a successful newAccount 1316 request. If the account is deactivated by the client or revoked by 1317 the server, it moves to the corresponding state. 1319 valid 1320 | 1321 | 1322 +-----------+-----------+ 1323 Client | Server | 1324 deactiv.| revoke | 1325 V V 1326 deactivated revoked 1328 Note that some of these states may not ever appear in a "status" 1329 field, depending on server behavior. For example, a server that 1330 issues synchronously will never show an order in the "processing" 1331 state. A server that deletes expired authorizations immediately will 1332 never show an authorization in the "expired" state. 1334 7.2. Getting a Nonce 1336 Before sending a POST request to the server, an ACME client needs to 1337 have a fresh anti-replay nonce to put in the "nonce" header of the 1338 JWS. In most cases, the client will have gotten a nonce from a 1339 previous request. However, the client might sometimes need to get a 1340 new nonce, e.g., on its first request to the server or if an existing 1341 nonce is no longer valid. 1343 To get a fresh nonce, the client sends a HEAD request to the new- 1344 nonce resource on the server. The server's response MUST include a 1345 Replay-Nonce header field containing a fresh nonce, and SHOULD have 1346 status code 200 (OK). The server SHOULD also respond to GET requests 1347 for this resource, returning an empty body (while still providing a 1348 Replay-Nonce header) with a 204 (No Content) status. 1350 HEAD /acme/new-nonce HTTP/1.1 1351 Host: example.com 1353 HTTP/1.1 200 OK 1354 Replay-Nonce: oFvnlFP1wIhRlYS2jTaXbA 1355 Cache-Control: no-store 1357 Proxy caching of responses from the new-nonce resource can cause 1358 clients receive the same nonce repeatedly, leading to badNonce 1359 errors. The server MUST include a Cache-Control header field with 1360 the "no-store" directive in responses for the new-nonce resource, in 1361 order to prevent caching of this resource. 1363 7.3. Account Creation 1365 A client creates a new account with the server by sending a POST 1366 request to the server's new-account URL. The body of the request is 1367 a stub account object optionally containing the "contact" and 1368 "termsOfServiceAgreed" fields. 1370 contact (optional, array of string): Same meaning as the 1371 corresponding server field defined in Section 7.1.2 1373 termsOfServiceAgreed (optional, boolean): Same meaning as the 1374 corresponding server field defined in Section 7.1.2 1376 onlyReturnExisting (optional, boolean): If this field is present 1377 with the value "true", then the server MUST NOT create a new 1378 account if one does not already exist. This allows a client to 1379 look up an account URL based on an account key (see 1380 Section 7.3.1). 1382 POST /acme/new-account HTTP/1.1 1383 Host: example.com 1384 Content-Type: application/jose+json 1386 { 1387 "protected": base64url({ 1388 "alg": "ES256", 1389 "jwk": {...}, 1390 "nonce": "6S8IqOGY7eL2lsGoTZYifg", 1391 "url": "https://example.com/acme/new-account" 1392 }), 1393 "payload": base64url({ 1394 "termsOfServiceAgreed": true, 1395 "contact": [ 1396 "mailto:cert-admin@example.com", 1397 "mailto:admin@example.com" 1398 ] 1399 }), 1400 "signature": "RZPOnYoPs1PhjszF...-nh6X1qtOFPB519I" 1401 } 1403 The server MUST ignore any values provided in the "orders" fields in 1404 account bodies sent by the client, as well as any other fields that 1405 it does not recognize. If new fields are specified in the future, 1406 the specification of those fields MUST describe whether they can be 1407 provided by the client. 1409 In general, the server MUST ignore any fields in the request object 1410 that it does not recognize. In particular, it MUST NOT reflect 1411 unrecognized fields in the resulting account object. This allows 1412 clients to detect when servers do not support an extension field. 1414 The server SHOULD validate that the contact URLs in the "contact" 1415 field are valid and supported by the server. If the server validates 1416 contact URLs it MUST support the "mailto" scheme. Clients MUST NOT 1417 provide a "mailto" URL in the "contact" field that contains "hfields" 1418 [RFC6068], or more than one "addr-spec" in the "to" component. If a 1419 server encounters a "mailto" contact URL that does not meet these 1420 criteria, then it SHOULD reject it as invalid. 1422 If the server rejects a contact URL for using an unsupported scheme 1423 it MUST return an error of type "unsupportedContact", with a 1424 description describing the error and what types of contact URLs the 1425 server considers acceptable. If the server rejects a contact URL for 1426 using a supported scheme but an invalid value then the server MUST 1427 return an error of type "invalidContact". 1429 If the server wishes to present the client with terms under which the 1430 ACME service is to be used, it MUST indicate the URL where such terms 1431 can be accessed in the "termsOfService" subfield of the "meta" field 1432 in the directory object, and the server MUST reject new-account 1433 requests that do not have the "termsOfServiceAgreed" field set to 1434 "true". Clients SHOULD NOT automatically agree to terms by default. 1435 Rather, they SHOULD require some user interaction for agreement to 1436 terms. 1438 The server creates an account and stores the public key used to 1439 verify the JWS (i.e., the "jwk" element of the JWS header) to 1440 authenticate future requests from the account. The server returns 1441 this account object in a 201 (Created) response, with the account URL 1442 in a Location header field. The account URL is used as the "kid" 1443 value in the JWS authenticating subsequent requests by this account 1444 (See Section 6.2). 1446 HTTP/1.1 201 Created 1447 Content-Type: application/json 1448 Replay-Nonce: D8s4D2mLs8Vn-goWuPQeKA 1449 Location: https://example.com/acme/acct/1 1450 Link: ;rel="index" 1452 { 1453 "status": "valid", 1455 "contact": [ 1456 "mailto:cert-admin@example.com", 1457 "mailto:admin@example.com" 1458 ] 1459 } 1461 7.3.1. Finding an Account URL Given a Key 1463 If the server already has an account registered with the provided 1464 account key, then it MUST return a response with a 200 (OK) status 1465 code and provide the URL of that account in the Location header 1466 field. This allows a client that has an account key but not the 1467 corresponding account URL to recover the account URL. 1469 If a client wishes to find the URL for an existing account and does 1470 not want an account to be created if one does not already exist, then 1471 it SHOULD do so by sending a POST request to the new-account URL with 1472 a JWS whose payload has an "onlyReturnExisting" field set to "true" 1473 ({"onlyReturnExisting": true}). If a client sends such a request and 1474 an account does not exist, then the server MUST return an error 1475 response with status code 400 (Bad Request) and type 1476 "urn:ietf:params:acme:error:accountDoesNotExist". 1478 7.3.2. Account Update 1480 If the client wishes to update this information in the future, it 1481 sends a POST request with updated information to the account URL. 1482 The server MUST ignore any updates to the "orders" field or any other 1483 fields it does not recognize. If the server accepts the update, it 1484 MUST return a response with a 200 (OK) status code and the resulting 1485 account object. 1487 For example, to update the contact information in the above account, 1488 the client could send the following request: 1490 POST /acme/acct/1 HTTP/1.1 1491 Host: example.com 1492 Content-Type: application/jose+json 1494 { 1495 "protected": base64url({ 1496 "alg": "ES256", 1497 "kid": "https://example.com/acme/acct/1", 1498 "nonce": "ax5RnthDqp_Yf4_HZnFLmA", 1499 "url": "https://example.com/acme/acct/1" 1500 }), 1501 "payload": base64url({ 1502 "contact": [ 1503 "mailto:certificates@example.com", 1504 "mailto:admin@example.com" 1505 ] 1506 }), 1507 "signature": "hDXzvcj8T6fbFbmn...rDzXzzvzpRy64N0o" 1508 } 1510 7.3.3. Account Information 1512 Servers MUST NOT respond to GET requests for account resources as 1513 these requests are not authenticated. If a client wishes to query 1514 the server for information about its account (e.g., to examine the 1515 "contact" or "orders" fields), then it SHOULD do so by sending a POST 1516 request with an empty update. That is, it should send a JWS whose 1517 payload is an empty object ({}). 1519 7.3.4. Changes of Terms of Service 1521 As described above, a client can indicate its agreement with the CA's 1522 terms of service by setting the "termsOfServiceAgreed" field in its 1523 account object to "true". 1525 If the server has changed its terms of service since a client 1526 initially agreed, and the server is unwilling to process a request 1527 without explicit agreement to the new terms, then it MUST return an 1528 error response with status code 403 (Forbidden) and type 1529 "urn:ietf:params:acme:error:userActionRequired". This response MUST 1530 include a Link header with link relation "terms-of-service" and the 1531 latest terms-of-service URL. 1533 The problem document returned with the error MUST also include an 1534 "instance" field, indicating a URL that the client should direct a 1535 human user to visit in order for instructions on how to agree to the 1536 terms. 1538 HTTP/1.1 403 Forbidden 1539 Replay-Nonce: IXVHDyxIRGcTE0VSblhPzw 1540 Link: ;rel="terms-of-service" 1541 Content-Type: application/problem+json 1542 Content-Language: en 1544 { 1545 "type": "urn:ietf:params:acme:error:userActionRequired", 1546 "detail": "Terms of service have changed", 1547 "instance": "https://example.com/acme/agreement/?token=W8Ih3PswD-8" 1548 } 1550 7.3.5. External Account Binding 1552 The server MAY require a value for the "externalAccountBinding" field 1553 to be present in "newAccount" requests. This can be used to 1554 associate an ACME account with an existing account in a non-ACME 1555 system, such as a CA customer database. 1557 To enable ACME account binding, a CA needs to provide the ACME client 1558 with a MAC key and a key identifier, using some mechanism outside of 1559 ACME. The key identifier MUST be an ASCII string. The MAC key 1560 SHOULD be provided in base64url-encoded form, to maximize 1561 compatibility between non-ACME provisioning systems and ACME clients. 1563 The ACME client then computes a binding JWS to indicate the external 1564 account holder's approval of the ACME account key. The payload of 1565 this JWS is the account key being registered, in JWK form. The 1566 protected header of the JWS MUST meet the following criteria: 1568 o The "alg" field MUST indicate a MAC-based algorithm 1570 o The "kid" field MUST contain the key identifier provided by the CA 1572 o The "nonce" field MUST NOT be present 1574 o The "url" field MUST be set to the same value as the outer JWS 1576 The "signature" field of the JWS will contain the MAC value computed 1577 with the MAC key provided by the CA. 1579 POST /acme/new-account HTTP/1.1 1580 Host: example.com 1581 Content-Type: application/jose+json 1583 { 1584 "protected": base64url({ 1585 "alg": "ES256", 1586 "jwk": /* account key */, 1587 "nonce": "K60BWPrMQG9SDxBDS_xtSw", 1588 "url": "https://example.com/acme/new-account" 1589 }), 1590 "payload": base64url({ 1591 "contact": ["mailto:example@anonymous.invalid"], 1592 "termsOfServiceAgreed": true, 1594 "externalAccountBinding": { 1595 "protected": base64url({ 1596 "alg": "HS256", 1597 "kid": /* key identifier from CA */, 1598 "url": "https://example.com/acme/new-account" 1599 }), 1600 "payload": base64url(/* same as in "jwk" above */), 1601 "signature": /* MAC using MAC key from CA */ 1602 } 1603 }), 1604 "signature": "5TWiqIYQfIDfALQv...x9C2mg8JGPxl5bI4" 1605 } 1607 If a CA requires that new-account requests contain an 1608 "externalAccountBinding" field, then it MUST provide the value "true" 1609 in the "externalAccountRequired" subfield of the "meta" field in the 1610 directory object. If the CA receives a new-account request without 1611 an "externalAccountBinding" field, then it SHOULD reply with an error 1612 of type "externalAccountRequired". 1614 When a CA receives a new-account request containing an 1615 "externalAccountBinding" field, it decides whether or not to verify 1616 the binding. If the CA does not verify the binding, then it MUST NOT 1617 reflect the "externalAccountBinding" field in the resulting account 1618 object (if any). To verify the account binding, the CA MUST take the 1619 following steps: 1621 1. Verify that the value of the field is a well-formed JWS 1623 2. Verify that the JWS protected field meets the above criteria 1625 3. Retrieve the MAC key corresponding to the key identifier in the 1626 "kid" field 1628 4. Verify that the MAC on the JWS verifies using that MAC key 1630 5. Verify that the payload of the JWS represents the same key as was 1631 used to verify the outer JWS (i.e., the "jwk" field of the outer 1632 JWS) 1634 If all of these checks pass and the CA creates a new account, then 1635 the CA may consider the new account associated with the external 1636 account corresponding to the MAC key and MUST reflect the value of 1637 the "externalAccountBinding" field in the resulting account object. 1638 If any of these checks fail, then the CA MUST reject the new-account 1639 request. 1641 7.3.6. Account Key Roll-over 1643 A client may wish to change the public key that is associated with an 1644 account in order to recover from a key compromise or proactively 1645 mitigate the impact of an unnoticed key compromise. 1647 To change the key associated with an account, the client first 1648 constructs a key-change object describing the change that it would 1649 like the server to make: 1651 account (required, string): The URL for the account being modified. 1652 The content of this field MUST be the exact string provided in the 1653 Location header field in response to the new-account request that 1654 created the account. 1656 newKey (required, JWK): The JWK representation of the new key 1658 The client then encapsulates the key-change object in an "inner" JWS, 1659 signed with the requested new account key (i.e., the key matching the 1660 "newKey" value). This JWS then becomes the payload for the "outer" 1661 JWS that is the body of the ACME request. 1663 The outer JWS MUST meet the normal requirements for an ACME JWS (see 1664 Section 6.2). The inner JWS MUST meet the normal requirements, with 1665 the following differences: 1667 o The inner JWS MUST have a "jwk" header parameter, containing the 1668 public key of the new key pair (i.e., the same value as the 1669 "newKey" field). 1671 o The inner JWS MUST have the same "url" header parameter as the 1672 outer JWS. 1674 o The inner JWS is NOT REQUIRED to have a "nonce" header parameter. 1675 The server MUST ignore any value provided for the "nonce" header 1676 parameter. 1678 This transaction has signatures from both the old and new keys so 1679 that the server can verify that the holders of the two keys both 1680 agree to the change. The signatures are nested to preserve the 1681 property that all signatures on POST messages are signed by exactly 1682 one key. 1684 POST /acme/key-change HTTP/1.1 1685 Host: example.com 1686 Content-Type: application/jose+json 1688 { 1689 "protected": base64url({ 1690 "alg": "ES256", 1691 "kid": "https://example.com/acme/acct/1", 1692 "nonce": "K60BWPrMQG9SDxBDS_xtSw", 1693 "url": "https://example.com/acme/key-change" 1694 }), 1695 "payload": base64url({ 1696 "protected": base64url({ 1697 "alg": "ES256", 1698 "jwk": /* new key */, 1699 "url": "https://example.com/acme/key-change" 1700 }), 1701 "payload": base64url({ 1702 "account": "https://example.com/acme/acct/1", 1703 "newKey": /* new key */ 1704 }), 1705 "signature": "Xe8B94RD30Azj2ea...8BmZIRtcSKPSd8gU" 1706 }), 1707 "signature": "5TWiqIYQfIDfALQv...x9C2mg8JGPxl5bI4" 1708 } 1710 On receiving key-change request, the server MUST perform the 1711 following steps in addition to the typical JWS validation: 1713 1. Validate the POST request belongs to a currently active account, 1714 as described in Section 6. 1716 2. Check that the payload of the JWS is a well-formed JWS object 1717 (the "inner JWS"). 1719 3. Check that the JWS protected header of the inner JWS has a "jwk" 1720 field. 1722 4. Check that the inner JWS verifies using the key in its "jwk" 1723 field. 1725 5. Check that the payload of the inner JWS is a well-formed key- 1726 change object (as described above). 1728 6. Check that the "url" parameters of the inner and outer JWSs are 1729 the same. 1731 7. Check that the "account" field of the key-change object contains 1732 the URL for the account matching the old key. 1734 8. Check that the "newKey" field of the key-change object also 1735 verifies the inner JWS. 1737 9. Check that no account exists whose account key is the same as the 1738 key in the "newKey" field. 1740 If all of these checks pass, then the server updates the 1741 corresponding account by replacing the old account key with the new 1742 public key and returns status code 200 (OK). Otherwise, the server 1743 responds with an error status code and a problem document describing 1744 the error. If there is an existing account with the new key 1745 provided, then the server SHOULD use status code 409 (Conflict) and 1746 provide the URL of that account in the Location header field. 1748 Note that changing the account key for an account SHOULD NOT have any 1749 other impact on the account. For example, the server MUST NOT 1750 invalidate pending orders or authorization transactions based on a 1751 change of account key. 1753 7.3.7. Account Deactivation 1755 A client can deactivate an account by posting a signed update to the 1756 server with a status field of "deactivated." Clients may wish to do 1757 this when the account key is compromised or decommissioned. 1759 POST /acme/acct/1 HTTP/1.1 1760 Host: example.com 1761 Content-Type: application/jose+json 1763 { 1764 "protected": base64url({ 1765 "alg": "ES256", 1766 "kid": "https://example.com/acme/acct/1", 1767 "nonce": "ntuJWWSic4WVNSqeUmshgg", 1768 "url": "https://example.com/acme/acct/1" 1769 }), 1770 "payload": base64url({ 1771 "status": "deactivated" 1772 }), 1773 "signature": "earzVLd3m5M4xJzR...bVTqn7R08AKOVf3Y" 1774 } 1776 The server MUST verify that the request is signed by the account key. 1777 If the server accepts the deactivation request, it replies with a 200 1778 (OK) status code and the current contents of the account object. 1780 Once an account is deactivated, the server MUST NOT accept further 1781 requests authorized by that account's key. The server SHOULD cancel 1782 any pending operations authorized by the account's key, such as 1783 certificate orders. A server may take a variety of actions in 1784 response to an account deactivation, e.g., deleting data related to 1785 that account or sending mail to the account's contacts. Servers 1786 SHOULD NOT revoke certificates issued by the deactivated account, 1787 since this could cause operational disruption for servers using these 1788 certificates. ACME does not provide a way to reactivate a 1789 deactivated account. 1791 7.4. Applying for Certificate Issuance 1793 The client requests certificate issuance by sending a POST request to 1794 the server's new-order resource. The body of the POST is a JWS 1795 object whose JSON payload is a subset of the order object defined in 1796 Section 7.1.3, containing the fields that describe the certificate to 1797 be issued: 1799 identifiers (required, array of object): An array of identifier 1800 objects that the client wishes to submit an order for. 1802 type (required, string): The type of identifier. 1804 value (required, string): The identifier itself. 1806 notBefore (optional, string): The requested value of the notBefore 1807 field in the certificate, in the date format defined in [RFC3339]. 1809 notAfter (optional, string): The requested value of the notAfter 1810 field in the certificate, in the date format defined in [RFC3339]. 1812 POST /acme/new-order HTTP/1.1 1813 Host: example.com 1814 Content-Type: application/jose+json 1816 { 1817 "protected": base64url({ 1818 "alg": "ES256", 1819 "kid": "https://example.com/acme/acct/1", 1820 "nonce": "5XJ1L3lEkMG7tR6pA00clA", 1821 "url": "https://example.com/acme/new-order" 1822 }), 1823 "payload": base64url({ 1824 "identifiers": [{"type:"dns","value":"example.com"}], 1825 "notBefore": "2016-01-01T00:00:00Z", 1826 "notAfter": "2016-01-08T00:00:00Z" 1827 }), 1828 "signature": "H6ZXtGjTZyUnPeKn...wEA4TklBdh3e454g" 1829 } 1831 The server MUST return an error if it cannot fulfill the request as 1832 specified, and MUST NOT issue a certificate with contents other than 1833 those requested. If the server requires the request to be modified 1834 in a certain way, it should indicate the required changes using an 1835 appropriate error type and description. 1837 If the server is willing to issue the requested certificate, it 1838 responds with a 201 (Created) response. The body of this response is 1839 an order object reflecting the client's request and any 1840 authorizations the client must complete before the certificate will 1841 be issued. 1843 HTTP/1.1 201 Created 1844 Replay-Nonce: MYAuvOpaoIiywTezizk5vw 1845 Location: https://example.com/acme/order/asdf 1847 { 1848 "status": "pending", 1849 "expires": "2016-01-01T00:00:00Z", 1851 "notBefore": "2016-01-01T00:00:00Z", 1852 "notAfter": "2016-01-08T00:00:00Z", 1854 "identifiers": [ 1855 { "type:"dns", "value":"example.com" }, 1856 { "type:"dns", "value":"www.example.com" } 1857 ], 1859 "authorizations": [ 1860 "https://example.com/acme/authz/1234", 1861 "https://example.com/acme/authz/2345" 1862 ], 1864 "finalize": "https://example.com/acme/order/asdf/finalize" 1865 } 1867 The order object returned by the server represents a promise that if 1868 the client fulfills the server's requirements before the "expires" 1869 time, then the server will be willing to finalize the order upon 1870 request and issue the requested certificate. In the order object, 1871 any authorization referenced in the "authorizations" array whose 1872 status is "pending" represents an authorization transaction that the 1873 client must complete before the server will issue the certificate 1874 (see Section 7.5). If the client fails to complete the required 1875 actions before the "expires" time, then the server SHOULD change the 1876 status of the order to "invalid" and MAY delete the order resource. 1878 Once the client believes it has fulfilled the server's requirements, 1879 it should send a POST request to the order resource's finalize URL. 1880 The POST body MUST include a CSR: 1882 csr (required, string): A CSR encoding the parameters for the 1883 certificate being requested [RFC2986]. The CSR is sent in the 1884 base64url-encoded version of the DER format. (Note: Because this 1885 field uses base64url, and does not include headers, it is 1886 different from PEM.). 1888 POST /acme/order/asdf/finalize HTTP/1.1 1889 Host: example.com 1890 Content-Type: application/jose+json 1892 { 1893 "protected": base64url({ 1894 "alg": "ES256", 1895 "kid": "https://example.com/acme/acct/1", 1896 "nonce": "MSF2j2nawWHPxxkE3ZJtKQ", 1897 "url": "https://example.com/acme/order/asdf/finalize" 1898 }), 1899 "payload": base64url({ 1900 "csr": "MIIBPTCBxAIBADBFMQ...FS6aKdZeGsysoCo4H9P", 1901 }), 1902 "signature": "uOrUfIIk5RyQ...nw62Ay1cl6AB" 1903 } 1905 The CSR encodes the client's requests with regard to the content of 1906 the certificate to be issued. The CSR MUST indicate the exact same 1907 set of requested identifiers as the initial new-order request, either 1908 in the commonName portion of the requested subject name, or in an 1909 extensionRequest attribute [RFC2985] requesting a subjectAltName 1910 extension. 1912 A request to finalize an order will result in error if the order 1913 indicated does not have status "pending", if the CSR and order 1914 identifiers differ, or if the account is not authorized for the 1915 identifiers indicated in the CSR. 1917 A valid request to finalize an order will return the order to be 1918 finalized. The client should begin polling the order by sending a 1919 GET request to the order resource to obtain its current state. The 1920 status of the order will indicate what action the client should take: 1922 o "invalid": The certificate will not be issued. Consider this 1923 order process abandoned. 1925 o "pending": The server does not believe that the client has 1926 fulfilled the requirements. Check the "authorizations" array for 1927 entries that are still pending. 1929 o "ready": The server agrees that the requirements have been 1930 fulfilled, and is awaiting finalization. Submit a finalization 1931 request. 1933 o "processing": The certificate is being issued. Send a GET request 1934 after the time given in the "Retry-After" header field of the 1935 response, if any. 1937 o "valid": The server has issued the certificate and provisioned its 1938 URL to the "certificate" field of the order. Download the 1939 certificate. 1941 HTTP/1.1 200 OK 1942 Replay-Nonce: CGf81JWBsq8QyIgPCi9Q9X 1943 Location: https://example.com/acme/order/asdf 1945 { 1946 "status": "valid", 1947 "expires": "2016-01-01T00:00:00Z", 1949 "notBefore": "2016-01-01T00:00:00Z", 1950 "notAfter": "2016-01-08T00:00:00Z", 1952 "identifiers": [ 1953 { "type:"dns", "value":"example.com" }, 1954 { "type:"dns", "value":"www.example.com" } 1955 ], 1957 "authorizations": [ 1958 "https://example.com/acme/authz/1234", 1959 "https://example.com/acme/authz/2345" 1960 ], 1962 "finalize": "https://example.com/acme/order/asdf/finalize", 1964 "certificate": "https://example.com/acme/cert/asdf" 1965 } 1967 7.4.1. Pre-Authorization 1969 The order process described above presumes that authorization objects 1970 are created reactively, in response to a certificate order. Some 1971 servers may also wish to enable clients to obtain authorization for 1972 an identifier proactively, outside of the context of a specific 1973 issuance. For example, a client hosting virtual servers for a 1974 collection of names might wish to obtain authorization before any 1975 virtual servers are created and only create a certificate when a 1976 virtual server starts up. 1978 In some cases, a CA running an ACME server might have a completely 1979 external, non-ACME process for authorizing a client to issue 1980 certificates for an identifier. In these cases, the CA should 1981 provision its ACME server with authorization objects corresponding to 1982 these authorizations and reflect them as already valid in any orders 1983 submitted by the client. 1985 If a CA wishes to allow pre-authorization within ACME, it can offer a 1986 "new authorization" resource in its directory by adding the field 1987 "newAuthz" with a URL for the new authorization resource. 1989 To request authorization for an identifier, the client sends a POST 1990 request to the new-authorization resource specifying the identifier 1991 for which authorization is being requested. 1993 identifier (required, object): The identifier to appear in the 1994 resulting authorization object (see Section 7.1.4) 1996 POST /acme/new-authz HTTP/1.1 1997 Host: example.com 1998 Content-Type: application/jose+json 2000 { 2001 "protected": base64url({ 2002 "alg": "ES256", 2003 "kid": "https://example.com/acme/acct/1", 2004 "nonce": "uQpSjlRb4vQVCjVYAyyUWg", 2005 "url": "https://example.com/acme/new-authz" 2006 }), 2007 "payload": base64url({ 2008 "identifier": { 2009 "type": "dns", 2010 "value": "example.net" 2011 } 2012 }), 2013 "signature": "nuSDISbWG8mMgE7H...QyVUL68yzf3Zawps" 2014 } 2016 Note that because the identifier in a pre-authorization request is 2017 the exact identifier to be included in the authorization object, pre- 2018 authorization cannot be used to authorize issuance with wildcard DNS 2019 identifiers. 2021 Before processing the authorization request, the server SHOULD 2022 determine whether it is willing to issue certificates for the 2023 identifier. For example, the server should check that the identifier 2024 is of a supported type. Servers might also check names against a 2025 blacklist of known high-value identifiers. If the server is 2026 unwilling to issue for the identifier, it SHOULD return a 403 2027 (Forbidden) error, with a problem document describing the reason for 2028 the rejection. 2030 If the server is willing to proceed, it builds a pending 2031 authorization object from the inputs submitted by the client: 2033 o "identifier" the identifier submitted by the client 2035 o "status" MUST be "pending" unless the server has out-of-band 2036 information about the client's authorization status 2038 o "challenges" as selected by the server's policy for this 2039 identifier 2041 The server allocates a new URL for this authorization, and returns a 2042 201 (Created) response, with the authorization URL in the Location 2043 header field, and the JSON authorization object in the body. The 2044 client then follows the process described in Section 7.5 to complete 2045 the authorization process. 2047 7.4.2. Downloading the Certificate 2049 To download the issued certificate, the client simply sends a GET 2050 request to the certificate URL. 2052 The default format of the certificate is application/pem-certificate- 2053 chain (see IANA Considerations). 2055 The server MAY provide one or more link relation header fields 2056 [RFC5988] with relation "alternate". Each such field SHOULD express 2057 an alternative certificate chain starting with the same end-entity 2058 certificate. This can be used to express paths to various trust 2059 anchors. Clients can fetch these alternates and use their own 2060 heuristics to decide which is optimal. 2062 GET /acme/cert/asdf HTTP/1.1 2063 Host: example.com 2064 Accept: application/pkix-cert 2066 HTTP/1.1 200 OK 2067 Content-Type: application/pem-certificate-chain 2068 Link: ;rel="index" 2070 -----BEGIN CERTIFICATE----- 2071 [End-entity certificate contents] 2072 -----END CERTIFICATE----- 2073 -----BEGIN CERTIFICATE----- 2074 [Issuer certificate contents] 2075 -----END CERTIFICATE----- 2076 -----BEGIN CERTIFICATE----- 2077 [Other certificate contents] 2078 -----END CERTIFICATE----- 2079 A certificate resource represents a single, immutable certificate. 2080 If the client wishes to obtain a renewed certificate, the client 2081 initiates a new order process to request one. 2083 Because certificate resources are immutable once issuance is 2084 complete, the server MAY enable the caching of the resource by adding 2085 Expires and Cache-Control headers specifying a point in time in the 2086 distant future. These headers have no relation to the certificate's 2087 period of validity. 2089 The ACME client MAY request other formats by including an Accept 2090 header in its request. For example, the client could use the media 2091 type "application/pkix-cert" [RFC2585] to request the end-entity 2092 certificate in DER format. Server support for alternate formats is 2093 OPTIONAL. For formats that can only express a single certificate, 2094 the server SHOULD provide one or more "Link: rel="up"" headers 2095 pointing to an issuer or issuers so that ACME clients can build a 2096 certificate chain as defined in TLS. 2098 7.5. Identifier Authorization 2100 The identifier authorization process establishes the authorization of 2101 an account to manage certificates for a given identifier. This 2102 process assures the server of two things: 2104 1. That the client controls the private key of the account key pair, 2105 and 2107 2. That the client controls the identifier in question. 2109 This process may be repeated to associate multiple identifiers to a 2110 key pair (e.g., to request certificates with multiple identifiers), 2111 or to associate multiple accounts with an identifier (e.g., to allow 2112 multiple entities to manage certificates). 2114 Authorization resources are created by the server in response to 2115 certificate orders or authorization requests submitted by an account 2116 key holder; their URLs are provided to the client in the responses to 2117 these requests. The authorization object is implicitly tied to the 2118 account key used to sign the request. 2120 When a client receives an order from the server it downloads the 2121 authorization resources by sending GET requests to the indicated 2122 URLs. If the client initiates authorization using a request to the 2123 new authorization resource, it will have already received the pending 2124 authorization object in the response to that request. 2126 GET /acme/authz/1234 HTTP/1.1 2127 Host: example.com 2129 HTTP/1.1 200 OK 2130 Content-Type: application/json 2131 Link: ;rel="index" 2133 { 2134 "status": "pending", 2135 "expires": "2018-03-03T14:09:00Z", 2137 "identifier": { 2138 "type": "dns", 2139 "value": "example.org" 2140 }, 2142 "challenges": [ 2143 { 2144 "type": "http-01", 2145 "url": "https://example.com/acme/authz/1234/0", 2146 "token": "DGyRejmCefe7v4NfDGDKfA" 2147 }, 2148 { 2149 "type": "dns-01", 2150 "url": "https://example.com/acme/authz/1234/2", 2151 "token": "DGyRejmCefe7v4NfDGDKfA" 2152 } 2153 ], 2155 "wildcard": false 2156 } 2158 7.5.1. Responding to Challenges 2160 To prove control of the identifier and receive authorization, the 2161 client needs to respond with information to complete the challenges. 2162 To do this, the client updates the authorization object received from 2163 the server by filling in any required information in the elements of 2164 the "challenges" dictionary. 2166 The client sends these updates back to the server in the form of a 2167 JSON object with contents as specified by the challenge type, carried 2168 in a POST request to the challenge URL (not authorization URL) once 2169 it is ready for the server to attempt validation. 2171 For example, if the client were to respond to the "http-01" challenge 2172 in the above authorization, it would send the following request: 2174 POST /acme/authz/1234/0 HTTP/1.1 2175 Host: example.com 2176 Content-Type: application/jose+json 2178 { 2179 "protected": base64url({ 2180 "alg": "ES256", 2181 "kid": "https://example.com/acme/acct/1", 2182 "nonce": "Q_s3MWoqT05TrdkM2MTDcw", 2183 "url": "https://example.com/acme/authz/1234/0" 2184 }), 2185 "payload": base64url({}), 2186 "signature": "9cbg5JO1Gf5YLjjz...SpkUfcdPai9uVYYQ" 2187 } 2189 The server updates the authorization document by updating its 2190 representation of the challenge with the response object provided by 2191 the client. The server MUST ignore any fields in the response object 2192 that are not specified as response fields for this type of challenge. 2193 The server provides a 200 (OK) response with the updated challenge 2194 object as its body. 2196 If the client's response is invalid for any reason or does not 2197 provide the server with appropriate information to validate the 2198 challenge, then the server MUST return an HTTP error. On receiving 2199 such an error, the client SHOULD undo any actions that have been 2200 taken to fulfill the challenge, e.g., removing files that have been 2201 provisioned to a web server. 2203 The server is said to "finalize" the authorization when it has 2204 completed one of the validations, by assigning the authorization a 2205 status of "valid" or "invalid", corresponding to whether it considers 2206 the account authorized for the identifier. If the final state is 2207 "valid", then the server MUST include an "expires" field. When 2208 finalizing an authorization, the server MAY remove challenges other 2209 than the one that was completed, and may modify the "expires" field. 2210 The server SHOULD NOT remove challenges with status "invalid". 2212 Usually, the validation process will take some time, so the client 2213 will need to poll the authorization resource to see when it is 2214 finalized. For challenges where the client can tell when the server 2215 has validated the challenge (e.g., by seeing an HTTP or DNS request 2216 from the server), the client SHOULD NOT begin polling until it has 2217 seen the validation request from the server. 2219 To check on the status of an authorization, the client sends a GET 2220 request to the authorization URL, and the server responds with the 2221 current authorization object. In responding to poll requests while 2222 the validation is still in progress, the server MUST return a 200 2223 (OK) response and MAY include a Retry-After header field to suggest a 2224 polling interval to the client. 2226 GET /acme/authz/1234 HTTP/1.1 2227 Host: example.com 2229 HTTP/1.1 200 OK 2230 Content-Type: application/json 2232 { 2233 "status": "valid", 2234 "expires": "2018-09-09T14:09:00Z", 2236 "identifier": { 2237 "type": "dns", 2238 "value": "example.org" 2239 }, 2241 "challenges": [ 2242 { 2243 "type": "http-01", 2244 "url": "https://example.com/acme/authz/1234/0", 2245 "status": "valid", 2246 "validated": "2014-12-01T12:05:00Z", 2247 "token": "IlirfxKKXAsHtmzK29Pj8A" 2248 } 2249 ], 2251 "wildcard": false 2252 } 2254 7.5.2. Deactivating an Authorization 2256 If a client wishes to relinquish its authorization to issue 2257 certificates for an identifier, then it may request that the server 2258 deactivates each authorization associated with it by sending POST 2259 requests with the static object {"status": "deactivated"} to each 2260 authorization URL. 2262 POST /acme/authz/1234 HTTP/1.1 2263 Host: example.com 2264 Content-Type: application/jose+json 2266 { 2267 "protected": base64url({ 2268 "alg": "ES256", 2269 "kid": "https://example.com/acme/acct/1", 2270 "nonce": "xWCM9lGbIyCgue8di6ueWQ", 2271 "url": "https://example.com/acme/authz/1234" 2272 }), 2273 "payload": base64url({ 2274 "status": "deactivated" 2275 }), 2276 "signature": "srX9Ji7Le9bjszhu...WTFdtujObzMtZcx4" 2277 } 2279 The server MUST verify that the request is signed by the account key 2280 corresponding to the account that owns the authorization. If the 2281 server accepts the deactivation, it should reply with a 200 (OK) 2282 status code and the updated contents of the authorization object. 2284 The server MUST NOT treat deactivated authorization objects as 2285 sufficient for issuing certificates. 2287 7.6. Certificate Revocation 2289 To request that a certificate be revoked, the client sends a POST 2290 request to the ACME server's revokeCert URL. The body of the POST is 2291 a JWS object whose JSON payload contains the certificate to be 2292 revoked: 2294 certificate (required, string): The certificate to be revoked, in 2295 the base64url-encoded version of the DER format. (Note: Because 2296 this field uses base64url, and does not include headers, it is 2297 different from PEM.) 2299 reason (optional, int): One of the revocation reasonCodes defined in 2300 Section 5.3.1 of [RFC5280] to be used when generating OCSP 2301 responses and CRLs. If this field is not set the server SHOULD 2302 omit the reasonCode CRL entry extension when generating OCSP 2303 responses and CRLs. The server MAY disallow a subset of 2304 reasonCodes from being used by the user. If a request contains a 2305 disallowed reasonCode the server MUST reject it with the error 2306 type "urn:ietf:params:acme:error:badRevocationReason". The 2307 problem document detail SHOULD indicate which reasonCodes are 2308 allowed. 2310 Revocation requests are different from other ACME requests in that 2311 they can be signed either with an account key pair or the key pair in 2312 the certificate. 2314 Example using an account key pair for the signature: 2316 POST /acme/revoke-cert HTTP/1.1 2317 Host: example.com 2318 Content-Type: application/jose+json 2320 { 2321 "protected": base64url({ 2322 "alg": "ES256", 2323 "kid": "https://example.com/acme/acct/1", 2324 "nonce": "JHb54aT_KTXBWQOzGYkt9A", 2325 "url": "https://example.com/acme/revoke-cert" 2326 }), 2327 "payload": base64url({ 2328 "certificate": "MIIEDTCCAvegAwIBAgIRAP8...", 2329 "reason": 4 2330 }), 2331 "signature": "Q1bURgJoEslbD1c5...3pYdSMLio57mQNN4" 2332 } 2334 Example using the certificate key pair for the signature: 2336 POST /acme/revoke-cert HTTP/1.1 2337 Host: example.com 2338 Content-Type: application/jose+json 2340 { 2341 "protected": base64url({ 2342 "alg": "RS256", 2343 "jwk": /* certificate's public key */, 2344 "nonce": "JHb54aT_KTXBWQOzGYkt9A", 2345 "url": "https://example.com/acme/revoke-cert" 2346 }), 2347 "payload": base64url({ 2348 "certificate": "MIIEDTCCAvegAwIBAgIRAP8...", 2349 "reason": 1 2350 }), 2351 "signature": "Q1bURgJoEslbD1c5...3pYdSMLio57mQNN4" 2352 } 2354 Before revoking a certificate, the server MUST verify that the key 2355 used to sign the request is authorized to revoke the certificate. 2356 The server MUST consider at least the following accounts authorized 2357 for a given certificate: 2359 o the account that issued the certificate. 2361 o an account that holds authorizations for all of the identifiers in 2362 the certificate. 2364 The server MUST also consider a revocation request valid if it is 2365 signed with the private key corresponding to the public key in the 2366 certificate. 2368 If the revocation succeeds, the server responds with status code 200 2369 (OK). If the revocation fails, the server returns an error. 2371 HTTP/1.1 200 OK 2372 Replay-Nonce: IXVHDyxIRGcTE0VSblhPzw 2373 Content-Length: 0 2375 --- or --- 2377 HTTP/1.1 403 Forbidden 2378 Replay-Nonce: IXVHDyxIRGcTE0VSblhPzw 2379 Content-Type: application/problem+json 2380 Content-Language: en 2382 { 2383 "type": "urn:ietf:params:acme:error:unauthorized", 2384 "detail": "No authorization provided for name example.net" 2385 } 2387 8. Identifier Validation Challenges 2389 There are few types of identifiers in the world for which there is a 2390 standardized mechanism to prove possession of a given identifier. In 2391 all practical cases, CAs rely on a variety of means to test whether 2392 an entity applying for a certificate with a given identifier actually 2393 controls that identifier. 2395 Challenges provide the server with assurance that an account holder 2396 is also the entity that controls an identifier. For each type of 2397 challenge, it must be the case that in order for an entity to 2398 successfully complete the challenge the entity must both: 2400 o Hold the private key of the account key pair used to respond to 2401 the challenge 2403 o Control the identifier in question 2404 Section 10 documents how the challenges defined in this document meet 2405 these requirements. New challenges will need to document how they 2406 do. 2408 ACME uses an extensible challenge/response framework for identifier 2409 validation. The server presents a set of challenges in the 2410 authorization object it sends to a client (as objects in the 2411 "challenges" array), and the client responds by sending a response 2412 object in a POST request to a challenge URL. 2414 This section describes an initial set of challenge types. The 2415 definition of a challenge type includes: 2417 1. Content of challenge objects 2419 2. Content of response objects 2421 3. How the server uses the challenge and response to verify control 2422 of an identifier 2424 Challenge objects all contain the following basic fields: 2426 type (required, string): The type of challenge encoded in the 2427 object. 2429 url (required, string): The URL to which a response can be posted. 2431 status (required, string): The status of this challenge. Possible 2432 values are: "pending", "processing", "valid", and "invalid". 2434 validated (optional, string): The time at which the server validated 2435 this challenge, encoded in the format specified in RFC 3339 2436 [RFC3339]. This field is REQUIRED if the "status" field is 2437 "valid". 2439 error (optional, object): Error that occurred while the server was 2440 validating the challenge, if any, structured as a problem document 2441 [RFC7807]. Multiple errors can be indicated by using subproblems 2442 Section 6.6.1. 2444 All additional fields are specified by the challenge type. If the 2445 server sets a challenge's "status" to "invalid", it SHOULD also 2446 include the "error" field to help the client diagnose why the 2447 challenge failed. 2449 Different challenges allow the server to obtain proof of different 2450 aspects of control over an identifier. In some challenges, like HTTP 2451 and DNS, the client directly proves its ability to do certain things 2452 related to the identifier. The choice of which challenges to offer 2453 to a client under which circumstances is a matter of server policy. 2455 The identifier validation challenges described in this section all 2456 relate to validation of domain names. If ACME is extended in the 2457 future to support other types of identifiers, there will need to be 2458 new challenge types, and they will need to specify which types of 2459 identifier they apply to. 2461 8.1. Key Authorizations 2463 All challenges defined in this document make use of a key 2464 authorization string. A key authorization is a string that expresses 2465 a domain holder's authorization for a specified key to satisfy a 2466 specified challenge, by concatenating the token for the challenge 2467 with a key fingerprint, separated by a "." character: 2469 keyAuthorization = token || '.' || base64url(JWK_Thumbprint(accountKey)) 2471 The "JWK_Thumbprint" step indicates the computation specified in 2472 [RFC7638], using the SHA-256 digest [FIPS180-4]. As noted in 2473 [RFC7518] any prepended zero octets in the fields of a JWK object 2474 MUST be stripped before doing the computation. 2476 As specified in the individual challenges below, the token for a 2477 challenge is a string comprised entirely of characters in the URL- 2478 safe base64 alphabet. The "||" operator indicates concatenation of 2479 strings. 2481 8.2. Retrying Challenges 2483 ACME challenges typically require the client to set up some network- 2484 accessible resource that the server can query in order to validate 2485 that the client controls an identifier. In practice it is not 2486 uncommon for the server's queries to fail while a resource is being 2487 set up, e.g., due to information propagating across a cluster or 2488 firewall rules not being in place. 2490 Clients SHOULD NOT respond to challenges until they believe that the 2491 server's queries will succeed. If a server's initial validation 2492 query fails, the server SHOULD retry the query after some time, in 2493 order to account for delay in setting up responses such as DNS 2494 records or HTTP resources. The precise retry schedule is up to the 2495 server, but server operators should keep in mind the operational 2496 scenarios that the schedule is trying to accommodate. Given that 2497 retries are intended to address things like propagation delays in 2498 HTTP or DNS provisioning, there should not usually be any reason to 2499 retry more often than every 5 or 10 seconds. While the server is 2500 still trying, the status of the challenge remains "processing"; it is 2501 only marked "invalid" once the server has given up. 2503 The server MUST provide information about its retry state to the 2504 client via the "error" field in the challenge and the Retry-After 2505 HTTP header field in response to requests to the challenge resource. 2506 The server MUST add an entry to the "error" field in the challenge 2507 after each failed validation query. The server SHOULD set the Retry- 2508 After header field to a time after the server's next validation 2509 query, since the status of the challenge will not change until that 2510 time. 2512 Clients can explicitly request a retry by re-sending their response 2513 to a challenge in a new POST request (with a new nonce, etc.). This 2514 allows clients to request a retry when the state has changed (e.g., 2515 after firewall rules have been updated). Servers SHOULD retry a 2516 request immediately on receiving such a POST request. In order to 2517 avoid denial-of-service attacks via client-initiated retries, servers 2518 SHOULD rate-limit such requests. 2520 8.3. HTTP Challenge 2522 With HTTP validation, the client in an ACME transaction proves its 2523 control over a domain name by proving that it can provision HTTP 2524 resources on a server accessible under that domain name. The ACME 2525 server challenges the client to provision a file at a specific path, 2526 with a specific string as its content. 2528 As a domain may resolve to multiple IPv4 and IPv6 addresses, the 2529 server will connect to at least one of the hosts found in the DNS A 2530 and AAAA records, at its discretion. Because many web servers 2531 allocate a default HTTPS virtual host to a particular low-privilege 2532 tenant user in a subtle and non-intuitive manner, the challenge must 2533 be completed over HTTP, not HTTPS. 2535 type (required, string): The string "http-01" 2537 token (required, string): A random value that uniquely identifies 2538 the challenge. This value MUST have at least 128 bits of entropy. 2539 It MUST NOT contain any characters outside the base64url alphabet, 2540 and MUST NOT include base64 padding characters ("="). 2542 GET /acme/authz/1234/0 HTTP/1.1 2543 Host: example.com 2545 HTTP/1.1 200 OK 2546 Content-Type: application/json 2548 { 2549 "type": "http-01", 2550 "url": "https://example.com/acme/authz/0", 2551 "status": "pending", 2552 "token": "LoqXcYV8q5ONbJQxbmR7SCTNo3tiAXDfowyjxAjEuX0" 2553 } 2555 A client fulfills this challenge by constructing a key authorization 2556 from the "token" value provided in the challenge and the client's 2557 account key. The client then provisions the key authorization as a 2558 resource on the HTTP server for the domain in question. 2560 The path at which the resource is provisioned is comprised of the 2561 fixed prefix "/.well-known/acme-challenge/", followed by the "token" 2562 value in the challenge. The value of the resource MUST be the ASCII 2563 representation of the key authorization. 2565 GET /.well-known/acme-challenge/LoqXcYV8q5ONbJQxbmR7SCTNo3tiAXDfowyjxAjEuX0 2566 Host: example.org 2568 HTTP/1.1 200 OK 2569 Content-Type: application/octet-stream 2571 LoqXcYV8q5ONbJQxbmR7SCTNo3tiAXDfowyjxAjEuX0.9jg46WB3rR_AHD-EBXdN7cBkH1WOu0tA3M9fm21mqTI 2573 A client responds with an empty object ({}) to acknowledge that the 2574 challenge can be validated by the server. 2576 POST /acme/authz/1234/0 2577 Host: example.com 2578 Content-Type: application/jose+json 2580 { 2581 "protected": base64url({ 2582 "alg": "ES256", 2583 "kid": "https://example.com/acme/acct/1", 2584 "nonce": "JHb54aT_KTXBWQOzGYkt9A", 2585 "url": "https://example.com/acme/authz/1234/0" 2586 }), 2587 "payload": base64url({}), 2588 "signature": "Q1bURgJoEslbD1c5...3pYdSMLio57mQNN4" 2589 } 2590 On receiving a response, the server constructs and stores the key 2591 authorization from the challenge "token" value and the current client 2592 account key. 2594 Given a challenge/response pair, the server verifies the client's 2595 control of the domain by verifying that the resource was provisioned 2596 as expected. 2598 1. Construct a URL by populating the URL template [RFC6570] 2599 "http://{domain}/.well-known/acme-challenge/{token}", where: 2601 * the domain field is set to the domain name being verified; and 2603 * the token field is set to the token in the challenge. 2605 2. Verify that the resulting URL is well-formed. 2607 3. Dereference the URL using an HTTP GET request. This request MUST 2608 be sent to TCP port 80 on the HTTP server. 2610 4. Verify that the body of the response is well-formed key 2611 authorization. The server SHOULD ignore whitespace characters at 2612 the end of the body. 2614 5. Verify that key authorization provided by the HTTP server matches 2615 the key authorization stored by the server. 2617 The server SHOULD follow redirects when dereferencing the URL. 2619 If all of the above verifications succeed, then the validation is 2620 successful. If the request fails, or the body does not pass these 2621 checks, then it has failed. 2623 8.4. DNS Challenge 2625 When the identifier being validated is a domain name, the client can 2626 prove control of that domain by provisioning a TXT resource record 2627 containing a designated value for a specific validation domain name. 2629 type (required, string): The string "dns-01" 2631 token (required, string): A random value that uniquely identifies 2632 the challenge. This value MUST have at least 128 bits of entropy. 2633 It MUST NOT contain any characters outside the base64url alphabet, 2634 including padding characters ("="). 2636 GET /acme/authz/1234/2 HTTP/1.1 2637 Host: example.com 2639 HTTP/1.1 200 OK 2640 Content-Type: application/json 2642 { 2643 "type": "dns-01", 2644 "url": "https://example.com/acme/authz/1234/2", 2645 "status": "pending", 2646 "token": "evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA" 2647 } 2649 A client fulfills this challenge by constructing a key authorization 2650 from the "token" value provided in the challenge and the client's 2651 account key. The client then computes the SHA-256 digest [FIPS180-4] 2652 of the key authorization. 2654 The record provisioned to the DNS contains the base64url encoding of 2655 this digest. The client constructs the validation domain name by 2656 prepending the label "_acme-challenge" to the domain name being 2657 validated, then provisions a TXT record with the digest value under 2658 that name. For example, if the domain name being validated is 2659 "example.org", then the client would provision the following DNS 2660 record: 2662 _acme-challenge.example.org. 300 IN TXT "gfj9Xq...Rg85nM" 2664 A client responds with an empty object ({}) to acknowledge that the 2665 challenge can be validated by the server. 2667 POST /acme/authz/1234/2 2668 Host: example.com 2669 Content-Type: application/jose+json 2671 { 2672 "protected": base64url({ 2673 "alg": "ES256", 2674 "kid": "https://example.com/acme/acct/1", 2675 "nonce": "JHb54aT_KTXBWQOzGYkt9A", 2676 "url": "https://example.com/acme/authz/1234/2" 2677 }), 2678 "payload": base64url({}), 2679 "signature": "Q1bURgJoEslbD1c5...3pYdSMLio57mQNN4" 2680 } 2681 On receiving a response, the server constructs and stores the key 2682 authorization from the challenge "token" value and the current client 2683 account key. 2685 To validate a DNS challenge, the server performs the following steps: 2687 1. Compute the SHA-256 digest [FIPS180-4] of the stored key 2688 authorization 2690 2. Query for TXT records for the validation domain name 2692 3. Verify that the contents of one of the TXT records match the 2693 digest value 2695 If all of the above verifications succeed, then the validation is 2696 successful. If no DNS record is found, or DNS record and response 2697 payload do not pass these checks, then the validation fails. 2699 9. IANA Considerations 2701 9.1. MIME Type: application/pem-certificate-chain 2703 The "Media Types" registry should be updated with the following 2704 additional value: 2706 MIME media type name: application 2708 MIME subtype name: pem-certificate-chain 2710 Required parameters: None 2712 Optional parameters: None 2714 Encoding considerations: None 2716 Security considerations: Carries a cryptographic certificate and its 2717 associated certificate chain 2719 Interoperability considerations: None 2721 Published specification: draft-ietf-acme-acme [[ RFC EDITOR: Please 2722 replace draft-ietf-acme-acme above with the RFC number assigned to 2723 this ]] 2725 Applications which use this media type: Any MIME-compliant transport 2727 Additional information: 2729 File contains one or more certificates encoded with the PEM textual 2730 encoding, according to RFC 7468 [RFC7468]. In order to provide easy 2731 interoperation with TLS, the first certificate MUST be an end-entity 2732 certificate. Each following certificate SHOULD directly certify one 2733 preceding it. Because certificate validation requires that trust 2734 anchors be distributed independently, a certificate that specifies a 2735 trust anchor MAY be omitted from the chain, provided that supported 2736 peers are known to possess any omitted certificates. 2738 9.2. Well-Known URI for the HTTP Challenge 2740 The "Well-Known URIs" registry should be updated with the following 2741 additional value (using the template from [RFC5785]): 2743 URI suffix: acme-challenge 2745 Change controller: IETF 2747 Specification document(s): This document, Section Section 8.3 2749 Related information: N/A 2751 9.3. Replay-Nonce HTTP Header 2753 The "Message Headers" registry should be updated with the following 2754 additional value: 2756 +-------------------+----------+----------+---------------+ 2757 | Header Field Name | Protocol | Status | Reference | 2758 +-------------------+----------+----------+---------------+ 2759 | Replay-Nonce | http | standard | Section 6.4.1 | 2760 +-------------------+----------+----------+---------------+ 2762 9.4. "url" JWS Header Parameter 2764 The "JSON Web Signature and Encryption Header Parameters" registry 2765 should be updated with the following additional value: 2767 o Header Parameter Name: "url" 2769 o Header Parameter Description: URL 2771 o Header Parameter Usage Location(s): JWE, JWS 2773 o Change Controller: IESG 2775 o Specification Document(s): Section 6.3.1 of RFC XXXX 2777 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2778 to this document ]] 2780 9.5. "nonce" JWS Header Parameter 2782 The "JSON Web Signature and Encryption Header Parameters" registry 2783 should be updated with the following additional value: 2785 o Header Parameter Name: "nonce" 2787 o Header Parameter Description: Nonce 2789 o Header Parameter Usage Location(s): JWE, JWS 2791 o Change Controller: IESG 2793 o Specification Document(s): Section 6.4.2 of RFC XXXX 2795 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2796 to this document ]] 2798 9.6. URN Sub-namespace for ACME (urn:ietf:params:acme) 2800 The "IETF URN Sub-namespace for Registered Protocol Parameter 2801 Identifiers" registry should be updated with the following additional 2802 value, following the template in [RFC3553]: 2804 Registry name: acme 2806 Specification: RFC XXXX 2808 Repository: URL-TBD 2810 Index value: No transformation needed. 2812 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2813 to this document, and replace URL-TBD with the URL assigned by IANA 2814 for registries of ACME parameters. ]] 2816 9.7. New Registries 2818 This document requests that IANA create the following new registries: 2820 1. ACME Account Object Fields (Section 9.7.1) 2822 2. ACME Order Object Fields (Section 9.7.2) 2824 3. ACME Error Types (Section 9.7.4) 2825 4. ACME Resource Types (Section 9.7.5) 2827 5. ACME Directory Metadata Fields (Section 9.7.6) 2829 6. ACME Identifier Types (Section 9.7.7) 2831 7. ACME Validation Methods (Section 9.7.8) 2833 All of these registries are under a heading of "Automated Certificate 2834 Management Environment (ACME) Protocol" and are administered under a 2835 Specification Required policy [RFC8126]. 2837 9.7.1. Fields in Account Objects 2839 This registry lists field names that are defined for use in ACME 2840 account objects. Fields marked as "configurable" may be included in 2841 a new-account request. 2843 Template: 2845 o Field name: The string to be used as a field name in the JSON 2846 object 2848 o Field type: The type of value to be provided, e.g., string, 2849 boolean, array of string 2851 o Client configurable: Boolean indicating whether the server should 2852 accept values provided by the client 2854 o Reference: Where this field is defined 2856 Initial contents: The fields and descriptions defined in 2857 Section 7.1.2. 2859 +------------------------+---------------+--------------+-----------+ 2860 | Field Name | Field Type | Configurable | Reference | 2861 +------------------------+---------------+--------------+-----------+ 2862 | status | string | false | RFC XXXX | 2863 | | | | | 2864 | contact | array of | true | RFC XXXX | 2865 | | string | | | 2866 | | | | | 2867 | externalAccountBinding | object | true | RFC XXXX | 2868 | | | | | 2869 | termsOfServiceAgreed | boolean | true | RFC XXXX | 2870 | | | | | 2871 | orders | array of | false | RFC XXXX | 2872 | | string | | | 2873 +------------------------+---------------+--------------+-----------+ 2875 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2876 to this document ]] 2878 9.7.2. Fields in Order Objects 2880 This registry lists field names that are defined for use in ACME 2881 order objects. Fields marked as "configurable" may be included in a 2882 new-order request. 2884 Template: 2886 o Field name: The string to be used as a field name in the JSON 2887 object 2889 o Field type: The type of value to be provided, e.g., string, 2890 boolean, array of string 2892 o Client configurable: Boolean indicating whether the server should 2893 accept values provided by the client 2895 o Reference: Where this field is defined 2897 Initial contents: The fields and descriptions defined in 2898 Section 7.1.3. 2900 +----------------+-----------------+--------------+-----------+ 2901 | Field Name | Field Type | Configurable | Reference | 2902 +----------------+-----------------+--------------+-----------+ 2903 | status | string | false | RFC XXXX | 2904 | | | | | 2905 | expires | string | false | RFC XXXX | 2906 | | | | | 2907 | identifiers | array of object | true | RFC XXXX | 2908 | | | | | 2909 | notBefore | string | true | RFC XXXX | 2910 | | | | | 2911 | notAfter | string | true | RFC XXXX | 2912 | | | | | 2913 | authorizations | array of string | false | RFC XXXX | 2914 | | | | | 2915 | finalize | string | false | RFC XXXX | 2916 | | | | | 2917 | certificate | string | false | RFC XXXX | 2918 +----------------+-----------------+--------------+-----------+ 2920 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2921 to this document ]] 2923 9.7.3. Fields in Authorization Objects 2925 This registry lists field names that are defined for use in ACME 2926 authorization objects. Fields marked as "configurable" may be 2927 included in a new-authorization request. 2929 Template: 2931 o Field name: The string to be used as a field name in the JSON 2932 object 2934 o Field type: The type of value to be provided, e.g., string, 2935 boolean, array of string 2937 o Client configurable: Boolean indicating whether the server should 2938 accept values provided by the client 2940 o Reference: Where this field is defined 2942 Initial contents: The fields and descriptions defined in 2943 Section 7.1.4. 2945 +------------+-----------------+--------------+-----------+ 2946 | Field Name | Field Type | Configurable | Reference | 2947 +------------+-----------------+--------------+-----------+ 2948 | identifier | object | true | RFC XXXX | 2949 | | | | | 2950 | status | string | false | RFC XXXX | 2951 | | | | | 2952 | expires | string | false | RFC XXXX | 2953 | | | | | 2954 | challenges | array of object | false | RFC XXXX | 2955 | | | | | 2956 | wildcard | boolean | false | RFC XXXX | 2957 +------------+-----------------+--------------+-----------+ 2959 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2960 to this document ]] 2962 9.7.4. Error Types 2964 This registry lists values that are used within URN values that are 2965 provided in the "type" field of problem documents in ACME. 2967 Template: 2969 o Type: The label to be included in the URN for this error, 2970 following "urn:ietf:params:acme:error:" 2972 o Description: A human-readable description of the error 2974 o Reference: Where the error is defined 2976 Initial contents: The types and descriptions in the table in 2977 Section 6.6 above, with the Reference field set to point to this 2978 specification. 2980 9.7.5. Resource Types 2982 This registry lists the types of resources that ACME servers may list 2983 in their directory objects. 2985 Template: 2987 o Field name: The value to be used as a field name in the directory 2988 object 2990 o Resource type: The type of resource labeled by the field 2992 o Reference: Where the resource type is defined 2993 Initial contents: 2995 +------------+--------------------+-----------+ 2996 | Field Name | Resource Type | Reference | 2997 +------------+--------------------+-----------+ 2998 | newNonce | New nonce | RFC XXXX | 2999 | | | | 3000 | newAccount | New account | RFC XXXX | 3001 | | | | 3002 | newOrder | New order | RFC XXXX | 3003 | | | | 3004 | newAuthz | New authorization | RFC XXXX | 3005 | | | | 3006 | revokeCert | Revoke certificate | RFC XXXX | 3007 | | | | 3008 | keyChange | Key change | RFC XXXX | 3009 | | | | 3010 | meta | Metadata object | RFC XXXX | 3011 +------------+--------------------+-----------+ 3013 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 3014 to this document ]] 3016 9.7.6. Fields in the "meta" Object within a Directory Object 3018 This registry lists field names that are defined for use in the JSON 3019 object included in the "meta" field of an ACME directory object. 3021 Template: 3023 o Field name: The string to be used as a field name in the JSON 3024 object 3026 o Field type: The type of value to be provided, e.g., string, 3027 boolean, array of string 3029 o Reference: Where this field is defined 3031 Initial contents: The fields and descriptions defined in 3032 Section 7.1.2. 3034 +-------------------------+-----------------+-----------+ 3035 | Field Name | Field Type | Reference | 3036 +-------------------------+-----------------+-----------+ 3037 | termsOfService | string | RFC XXXX | 3038 | | | | 3039 | website | string | RFC XXXX | 3040 | | | | 3041 | caaIdentities | array of string | RFC XXXX | 3042 | | | | 3043 | externalAccountRequired | boolean | RFC XXXX | 3044 +-------------------------+-----------------+-----------+ 3046 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 3047 to this document ]] 3049 9.7.7. Identifier Types 3051 This registry lists the types of identifiers that can be present in 3052 ACME authorization objects. 3054 Template: 3056 o Label: The value to be put in the "type" field of the identifier 3057 object 3059 o Reference: Where the identifier type is defined 3061 Initial contents: 3063 +-------+-----------+ 3064 | Label | Reference | 3065 +-------+-----------+ 3066 | dns | RFC XXXX | 3067 +-------+-----------+ 3069 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 3070 to this document ]] 3072 9.7.8. Validation Methods 3074 This registry lists identifiers for the ways that CAs can validate 3075 control of identifiers. Each method's entry must specify whether it 3076 corresponds to an ACME challenge type. The "Identifier Type" field 3077 must be contained in the Label column of the ACME Identifier Types 3078 registry. 3080 Template: 3082 o Label: The identifier for this validation method 3084 o Identifier Type: The type of identifier that this method applies 3085 to 3087 o ACME: "Y" if the validation method corresponds to an ACME 3088 challenge type; "N" otherwise. 3090 o Reference: Where the validation method is defined 3092 Initial Contents 3094 +------------+-----------------+------+-----------+ 3095 | Label | Identifier Type | ACME | Reference | 3096 +------------+-----------------+------+-----------+ 3097 | http-01 | dns | Y | RFC XXXX | 3098 | | | | | 3099 | dns-01 | dns | Y | RFC XXXX | 3100 | | | | | 3101 | tls-sni-01 | RESERVED | N | N/A | 3102 | | | | | 3103 | tls-sni-02 | RESERVED | N | N/A | 3104 +------------+-----------------+------+-----------+ 3106 When evaluating a request for an assignment in this registry, the 3107 designated expert should ensure that the method being registered has 3108 a clear, interoperable definition and does not overlap with existing 3109 validation methods. That is, it should not be possible for a client 3110 and server to follow the same set of actions to fulfill two different 3111 validation methods. 3113 Validation methods do not have to be compatible with ACME in order to 3114 be registered. For example, a CA might wish to register a validation 3115 method in order to support its use with the ACME extensions to CAA 3116 [I-D.ietf-acme-caa]. 3118 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 3119 to this document ]] 3121 10. Security Considerations 3123 ACME is a protocol for managing certificates that attest to 3124 identifier/key bindings. Thus the foremost security goal of ACME is 3125 to ensure the integrity of this process, i.e., to ensure that the 3126 bindings attested by certificates are correct and that only 3127 authorized entities can manage certificates. ACME identifies clients 3128 by their account keys, so this overall goal breaks down into two more 3129 precise goals: 3131 1. Only an entity that controls an identifier can get an 3132 authorization for that identifier 3134 2. Once authorized, an account key's authorizations cannot be 3135 improperly used by another account 3137 In this section, we discuss the threat model that underlies ACME and 3138 the ways that ACME achieves these security goals within that threat 3139 model. We also discuss the denial-of-service risks that ACME servers 3140 face, and a few other miscellaneous considerations. 3142 10.1. Threat Model 3144 As a service on the Internet, ACME broadly exists within the Internet 3145 threat model [RFC3552]. In analyzing ACME, it is useful to think of 3146 an ACME server interacting with other Internet hosts along two 3147 "channels": 3149 o An ACME channel, over which the ACME HTTPS requests are exchanged 3151 o A validation channel, over which the ACME server performs 3152 additional requests to validate a client's control of an 3153 identifier 3155 +------------+ 3156 | ACME | ACME Channel 3157 | Client |--------------------+ 3158 +------------+ | 3159 V 3160 +------------+ 3161 | ACME | 3162 | Server | 3163 +------------+ 3164 +------------+ | 3165 | Validation |<-------------------+ 3166 | Server | Validation Channel 3167 +------------+ 3169 In practice, the risks to these channels are not entirely separate, 3170 but they are different in most cases. Each channel, for example, 3171 uses a different communications pattern: the ACME channel will 3172 comprise inbound HTTPS connections to the ACME server and the 3173 validation channel outbound HTTP or DNS requests. 3175 Broadly speaking, ACME aims to be secure against active and passive 3176 attackers on any individual channel. Some vulnerabilities arise 3177 (noted below) when an attacker can exploit both the ACME channel and 3178 one of the others. 3180 On the ACME channel, in addition to network layer attackers, we also 3181 need to account for man-in-the-middle (MitM) attacks at the 3182 application layer, and for abusive use of the protocol itself. 3183 Protection against application layer MitM addresses potential 3184 attackers such as Content Distribution Networks (CDNs) and 3185 middleboxes with a TLS MitM function. Preventing abusive use of ACME 3186 means ensuring that an attacker with access to the validation channel 3187 can't obtain illegitimate authorization by acting as an ACME client 3188 (legitimately, in terms of the protocol). 3190 10.2. Integrity of Authorizations 3192 ACME allows anyone to request challenges for an identifier by 3193 registering an account key and sending a new-order request using that 3194 account key. The integrity of the authorization process thus depends 3195 on the identifier validation challenges to ensure that the challenge 3196 can only be completed by someone who both (1) holds the private key 3197 of the account key pair, and (2) controls the identifier in question. 3199 Validation responses need to be bound to an account key pair in order 3200 to avoid situations where an ACME MitM can switch out a legitimate 3201 domain holder's account key for one of his choosing, e.g.: 3203 o Legitimate domain holder registers account key pair A 3205 o MitM registers account key pair B 3207 o Legitimate domain holder sends a new-order request signed using 3208 account key A 3210 o MitM suppresses the legitimate request but sends the same request 3211 signed using account key B 3213 o ACME server issues challenges and MitM forwards them to the 3214 legitimate domain holder 3216 o Legitimate domain holder provisions the validation response 3218 o ACME server performs validation query and sees the response 3219 provisioned by the legitimate domain holder 3221 o Because the challenges were issued in response to a message signed 3222 account key B, the ACME server grants authorization to account key 3223 B (the MitM) instead of account key A (the legitimate domain 3224 holder) 3226 All of the challenges above have a binding between the account 3227 private key and the validation query made by the server, via the key 3228 authorization. The key authorization reflects the account public 3229 key, is provided to the server in the validation response over the 3230 validation channel and signed afterwards by the corresponding private 3231 key in the challenge response over the ACME channel. 3233 The association of challenges to identifiers is typically done by 3234 requiring the client to perform some action that only someone who 3235 effectively controls the identifier can perform. For the challenges 3236 in this document, the actions are: 3238 o HTTP: Provision files under .well-known on a web server for the 3239 domain 3241 o DNS: Provision DNS resource records for the domain 3243 There are several ways that these assumptions can be violated, both 3244 by misconfiguration and by attacks. For example, on a web server 3245 that allows non-administrative users to write to .well-known, any 3246 user can claim to own the web server's hostname by responding to an 3247 HTTP challenge. Similarly, if a server that can be used for ACME 3248 validation is compromised by a malicious actor, then that malicious 3249 actor can use that access to obtain certificates via ACME. 3251 The use of hosting providers is a particular risk for ACME 3252 validation. If the owner of the domain has outsourced operation of 3253 DNS or web services to a hosting provider, there is nothing that can 3254 be done against tampering by the hosting provider. As far as the 3255 outside world is concerned, the zone or website provided by the 3256 hosting provider is the real thing. 3258 More limited forms of delegation can also lead to an unintended party 3259 gaining the ability to successfully complete a validation 3260 transaction. For example, suppose an ACME server follows HTTP 3261 redirects in HTTP validation and a website operator provisions a 3262 catch-all redirect rule that redirects requests for unknown resources 3263 to a different domain. Then the target of the redirect could use 3264 that to get a certificate through HTTP validation since the 3265 validation path will not be known to the primary server. 3267 The DNS is a common point of vulnerability for all of these 3268 challenges. An entity that can provision false DNS records for a 3269 domain can attack the DNS challenge directly and can provision false 3270 A/AAAA records to direct the ACME server to send its HTTP validation 3271 query to a remote server of the attacker's choosing. There are a few 3272 different mitigations that ACME servers can apply: 3274 o Always querying the DNS using a DNSSEC-validating resolver 3275 (enhancing security for zones that are DNSSEC-enabled) 3277 o Querying the DNS from multiple vantage points to address local 3278 attackers 3280 o Applying mitigations against DNS off-path attackers, e.g., adding 3281 entropy to requests [I-D.vixie-dnsext-dns0x20] or only using TCP 3283 Given these considerations, the ACME validation process makes it 3284 impossible for any attacker on the ACME channel or a passive attacker 3285 on the validation channel to hijack the authorization process to 3286 authorize a key of the attacker's choice. 3288 An attacker that can only see the ACME channel would need to convince 3289 the validation server to provide a response that would authorize the 3290 attacker's account key, but this is prevented by binding the 3291 validation response to the account key used to request challenges. A 3292 passive attacker on the validation channel can observe the correct 3293 validation response and even replay it, but that response can only be 3294 used with the account key for which it was generated. 3296 An active attacker on the validation channel can subvert the ACME 3297 process, by performing normal ACME transactions and providing a 3298 validation response for his own account key. The risks due to 3299 hosting providers noted above are a particular case. 3301 It is RECOMMENDED that the server perform DNS queries and make HTTP 3302 connections from various network perspectives, in order to make MitM 3303 attacks harder. 3305 10.3. Denial-of-Service Considerations 3307 As a protocol run over HTTPS, standard considerations for TCP-based 3308 and HTTP-based DoS mitigation also apply to ACME. 3310 At the application layer, ACME requires the server to perform a few 3311 potentially expensive operations. Identifier validation transactions 3312 require the ACME server to make outbound connections to potentially 3313 attacker-controlled servers, and certificate issuance can require 3314 interactions with cryptographic hardware. 3316 In addition, an attacker can also cause the ACME server to send 3317 validation requests to a domain of its choosing by submitting 3318 authorization requests for the victim domain. 3320 All of these attacks can be mitigated by the application of 3321 appropriate rate limits. Issues closer to the front end, like POST 3322 body validation, can be addressed using HTTP request limiting. For 3323 validation and certificate requests, there are other identifiers on 3324 which rate limits can be keyed. For example, the server might limit 3325 the rate at which any individual account key can issue certificates 3326 or the rate at which validation can be requested within a given 3327 subtree of the DNS. And in order to prevent attackers from 3328 circumventing these limits simply by minting new accounts, servers 3329 would need to limit the rate at which accounts can be registered. 3331 10.4. Server-Side Request Forgery 3333 Server-Side Request Forgery (SSRF) attacks can arise when an attacker 3334 can cause a server to perform HTTP requests to an attacker-chosen 3335 URL. In the ACME HTTP challenge validation process, the ACME server 3336 performs an HTTP GET request to a URL in which the attacker can 3337 choose the domain. This request is made before the server has 3338 verified that the client controls the domain, so any client can cause 3339 a query to any domain. 3341 Some server implementations include information from the validation 3342 server's response (in order to facilitate debugging). Such 3343 implementations enable an attacker to extract this information from 3344 any web server that is accessible to the ACME server, even if it is 3345 not accessible to the ACME client. 3347 It might seem that the risk of SSRF through this channel is limited 3348 by the fact that the attacker can only control the domain of the URL, 3349 not the path. However, if the attacker first sets the domain to one 3350 they control, then they can send the server an HTTP redirect (e.g., a 3351 302 response) which will cause the server to query an arbitrary URL. 3353 In order to further limit the SSRF risk, ACME server operators should 3354 ensure that validation queries can only be sent to servers on the 3355 public Internet, and not, say, web services within the server 3356 operator's internal network. Since the attacker could make requests 3357 to these public servers himself, he can't gain anything extra through 3358 an SSRF attack on ACME aside from a layer of anonymization. 3360 10.5. CA Policy Considerations 3362 The controls on issuance enabled by ACME are focused on validating 3363 that a certificate applicant controls the identifier he claims. 3364 Before issuing a certificate, however, there are many other checks 3365 that a CA might need to perform, for example: 3367 o Has the client agreed to a subscriber agreement? 3369 o Is the claimed identifier syntactically valid? 3371 o For domain names: 3373 * If the leftmost label is a '*', then have the appropriate 3374 checks been applied? 3376 * Is the name on the Public Suffix List? 3378 * Is the name a high-value name? 3380 * Is the name a known phishing domain? 3382 o Is the key in the CSR sufficiently strong? 3384 o Is the CSR signed with an acceptable algorithm? 3386 o Has issuance been authorized or forbidden by a Certificate 3387 Authority Authorization (CAA) record? [RFC6844] 3389 CAs that use ACME to automate issuance will need to ensure that their 3390 servers perform all necessary checks before issuing. 3392 CAs using ACME to allow clients to agree to terms of service should 3393 keep in mind that ACME clients can automate this agreement, possibly 3394 not involving a human user. 3396 11. Operational Considerations 3398 There are certain factors that arise in operational reality that 3399 operators of ACME-based CAs will need to keep in mind when 3400 configuring their services. For example: 3402 11.1. DNS security 3404 As noted above, DNS forgery attacks against the ACME server can 3405 result in the server making incorrect decisions about domain control 3406 and thus mis-issuing certificates. Servers SHOULD perform DNS 3407 queries over TCP, which provides better resistance to some forgery 3408 attacks than DNS over UDP. 3410 An ACME-based CA will often need to make DNS queries, e.g., to 3411 validate control of DNS names. Because the security of such 3412 validations ultimately depends on the authenticity of DNS data, every 3413 possible precaution should be taken to secure DNS queries done by the 3414 CA. It is therefore RECOMMENDED that ACME-based CAs make all DNS 3415 queries via DNSSEC-validating stub or recursive resolvers. This 3416 provides additional protection to domains which choose to make use of 3417 DNSSEC. 3419 An ACME-based CA must use only a resolver if it trusts the resolver 3420 and every component of the network route by which it is accessed. It 3421 is therefore RECOMMENDED that ACME-based CAs operate their own 3422 DNSSEC-validating resolvers within their trusted network and use 3423 these resolvers both for both CAA record lookups and all record 3424 lookups in furtherance of a challenge scheme (A, AAAA, TXT, etc.). 3426 11.2. Token Entropy 3428 The http-01, and dns-01 validation methods mandate the usage of a 3429 random token value to uniquely identify the challenge. The value of 3430 the token is required to contain at least 128 bits of entropy for the 3431 following security properties. First, the ACME client should not be 3432 able to influence the ACME server's choice of token as this may allow 3433 an attacker to reuse a domain owner's previous challenge responses 3434 for a new validation request. Secondly, the entropy requirement 3435 prevents ACME clients from implementing a "naive" validation server 3436 that automatically replies to challenges without participating in the 3437 creation of the initial authorization request. 3439 11.3. Malformed Certificate Chains 3441 ACME provides certificate chains in the widely-used format known 3442 colloquially as PEM (though it may diverge from the actual Privacy 3443 Enhanced Mail specifications [RFC1421], as noted in [RFC7468]). Some 3444 current software will allow the configuration of a private key and a 3445 certificate in one PEM file, by concatenating the textual encodings 3446 of the two objects. In the context of ACME, such software might be 3447 vulnerable to "key replacement" attacks. A malicious ACME server 3448 could cause a client to use a private key of its choosing by 3449 including the key in the PEM file returned in response to a query for 3450 a certificate URL. 3452 When processing an file of type "application/pem-certificate-chain", 3453 a client SHOULD verify that the file contains only encoded 3454 certificates. If anything other than a certificate is found (i.e., 3455 if the string "-----BEGIN" is ever followed by anything other than 3456 "CERTIFICATE"), then the client MUST reject the file as invalid. 3458 12. Acknowledgements 3460 In addition to the editors listed on the front page, this document 3461 has benefited from contributions from a broad set of contributors, 3462 all the way back to its inception. 3464 o Peter Eckersley, EFF 3466 o Eric Rescorla, Mozilla 3468 o Seth Schoen, EFF 3469 o Alex Halderman, University of Michigan 3471 o Martin Thomson, Mozilla 3473 o Jakub Warmuz, University of Oxford 3475 o Sophie Herold, Hemio 3477 This document draws on many concepts established by Eric Rescorla's 3478 "Automated Certificate Issuance Protocol" draft. Martin Thomson 3479 provided helpful guidance in the use of HTTP. 3481 13. References 3483 13.1. Normative References 3485 [FIPS180-4] 3486 Department of Commerce, National., "NIST FIPS 180-4, 3487 Secure Hash Standard", March 2012, 3488 . 3491 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 3492 Requirement Levels", BCP 14, RFC 2119, 3493 DOI 10.17487/RFC2119, March 1997, 3494 . 3496 [RFC2585] Housley, R. and P. Hoffman, "Internet X.509 Public Key 3497 Infrastructure Operational Protocols: FTP and HTTP", 3498 RFC 2585, DOI 10.17487/RFC2585, May 1999, 3499 . 3501 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, 3502 DOI 10.17487/RFC2818, May 2000, 3503 . 3505 [RFC2985] Nystrom, M. and B. Kaliski, "PKCS #9: Selected Object 3506 Classes and Attribute Types Version 2.0", RFC 2985, 3507 DOI 10.17487/RFC2985, November 2000, 3508 . 3510 [RFC2986] Nystrom, M. and B. Kaliski, "PKCS #10: Certification 3511 Request Syntax Specification Version 1.7", RFC 2986, 3512 DOI 10.17487/RFC2986, November 2000, 3513 . 3515 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 3516 Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002, 3517 . 3519 [RFC3492] Costello, A., "Punycode: A Bootstring encoding of Unicode 3520 for Internationalized Domain Names in Applications 3521 (IDNA)", RFC 3492, DOI 10.17487/RFC3492, March 2003, 3522 . 3524 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 3525 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November 3526 2003, . 3528 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 3529 Resource Identifier (URI): Generic Syntax", STD 66, 3530 RFC 3986, DOI 10.17487/RFC3986, January 2005, 3531 . 3533 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 3534 Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, 3535 . 3537 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 3538 (TLS) Protocol Version 1.2", RFC 5246, 3539 DOI 10.17487/RFC5246, August 2008, 3540 . 3542 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 3543 Housley, R., and W. Polk, "Internet X.509 Public Key 3544 Infrastructure Certificate and Certificate Revocation List 3545 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 3546 . 3548 [RFC5890] Klensin, J., "Internationalized Domain Names for 3549 Applications (IDNA): Definitions and Document Framework", 3550 RFC 5890, DOI 10.17487/RFC5890, August 2010, 3551 . 3553 [RFC5988] Nottingham, M., "Web Linking", RFC 5988, 3554 DOI 10.17487/RFC5988, October 2010, 3555 . 3557 [RFC6068] Duerst, M., Masinter, L., and J. Zawinski, "The 'mailto' 3558 URI Scheme", RFC 6068, DOI 10.17487/RFC6068, October 2010, 3559 . 3561 [RFC6570] Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., 3562 and D. Orchard, "URI Template", RFC 6570, 3563 DOI 10.17487/RFC6570, March 2012, 3564 . 3566 [RFC6844] Hallam-Baker, P. and R. Stradling, "DNS Certification 3567 Authority Authorization (CAA) Resource Record", RFC 6844, 3568 DOI 10.17487/RFC6844, January 2013, 3569 . 3571 [RFC7159] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 3572 Interchange Format", RFC 7159, DOI 10.17487/RFC7159, March 3573 2014, . 3575 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 3576 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 3577 DOI 10.17487/RFC7231, June 2014, 3578 . 3580 [RFC7468] Josefsson, S. and S. Leonard, "Textual Encodings of PKIX, 3581 PKCS, and CMS Structures", RFC 7468, DOI 10.17487/RFC7468, 3582 April 2015, . 3584 [RFC7515] Jones, M., Bradley, J., and N. Sakimura, "JSON Web 3585 Signature (JWS)", RFC 7515, DOI 10.17487/RFC7515, May 3586 2015, . 3588 [RFC7518] Jones, M., "JSON Web Algorithms (JWA)", RFC 7518, 3589 DOI 10.17487/RFC7518, May 2015, 3590 . 3592 [RFC7638] Jones, M. and N. Sakimura, "JSON Web Key (JWK) 3593 Thumbprint", RFC 7638, DOI 10.17487/RFC7638, September 3594 2015, . 3596 [RFC7797] Jones, M., "JSON Web Signature (JWS) Unencoded Payload 3597 Option", RFC 7797, DOI 10.17487/RFC7797, February 2016, 3598 . 3600 [RFC7807] Nottingham, M. and E. Wilde, "Problem Details for HTTP 3601 APIs", RFC 7807, DOI 10.17487/RFC7807, March 2016, 3602 . 3604 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 3605 Writing an IANA Considerations Section in RFCs", BCP 26, 3606 RFC 8126, DOI 10.17487/RFC8126, June 2017, 3607 . 3609 13.2. Informative References 3611 [I-D.ietf-acme-caa] 3612 Landau, H., "CAA Record Extensions for Account URI and 3613 ACME Method Binding", draft-ietf-acme-caa-03 (work in 3614 progress), August 2017. 3616 [I-D.ietf-acme-ip] 3617 Shoemaker, R., "ACME IP Identifier Validation Extension", 3618 draft-ietf-acme-ip-01 (work in progress), September 2017. 3620 [I-D.ietf-acme-telephone] 3621 Peterson, J. and R. Barnes, "ACME Identifiers and 3622 Challenges for Telephone Numbers", draft-ietf-acme- 3623 telephone-01 (work in progress), October 2017. 3625 [I-D.vixie-dnsext-dns0x20] 3626 Vixie, P. and D. Dagon, "Use of Bit 0x20 in DNS Labels to 3627 Improve Transaction Identity", draft-vixie-dnsext- 3628 dns0x20-00 (work in progress), March 2008. 3630 [RFC1421] Linn, J., "Privacy Enhancement for Internet Electronic 3631 Mail: Part I: Message Encryption and Authentication 3632 Procedures", RFC 1421, DOI 10.17487/RFC1421, February 3633 1993, . 3635 [RFC3552] Rescorla, E. and B. Korver, "Guidelines for Writing RFC 3636 Text on Security Considerations", BCP 72, RFC 3552, 3637 DOI 10.17487/RFC3552, July 2003, 3638 . 3640 [RFC3553] Mealling, M., Masinter, L., Hardie, T., and G. Klyne, "An 3641 IETF URN Sub-namespace for Registered Protocol 3642 Parameters", BCP 73, RFC 3553, DOI 10.17487/RFC3553, June 3643 2003, . 3645 [RFC5785] Nottingham, M. and E. Hammer-Lahav, "Defining Well-Known 3646 Uniform Resource Identifiers (URIs)", RFC 5785, 3647 DOI 10.17487/RFC5785, April 2010, 3648 . 3650 [RFC7525] Sheffer, Y., Holz, R., and P. Saint-Andre, 3651 "Recommendations for Secure Use of Transport Layer 3652 Security (TLS) and Datagram Transport Layer Security 3653 (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May 3654 2015, . 3656 [W3C.CR-cors-20130129] 3657 Kesteren, A., "Cross-Origin Resource Sharing", World Wide 3658 Web Consortium CR CR-cors-20130129, January 2013, 3659 . 3661 13.3. URIs 3663 [1] https://github.com/ietf-wg-acme/acme 3665 Authors' Addresses 3667 Richard Barnes 3668 Cisco 3670 Email: rlb@ipv.sx 3672 Jacob Hoffman-Andrews 3673 EFF 3675 Email: jsha@eff.org 3677 Daniel McCarney 3678 Let's Encrypt 3680 Email: cpu@letsencrypt.org 3682 James Kasten 3683 University of Michigan 3685 Email: jdkasten@umich.edu