idnits 2.17.1 draft-ietf-acme-acme-11.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 27, 2018) is 2222 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 3674 == 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 28, 2018 EFF 6 D. McCarney 7 Let's Encrypt 8 J. Kasten 9 University of Michigan 10 March 27, 2018 12 Automatic Certificate Management Environment (ACME) 13 draft-ietf-acme-acme-11 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 28, 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 . . . . . . . . . . . . . . . . . . . . . 65 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 . . . . . . . . . . . . . . . . . . 67 130 9.7.8. Validation Methods . . . . . . . . . . . . . . . . . 68 131 10. Security Considerations . . . . . . . . . . . . . . . . . . . 69 132 10.1. Threat Model . . . . . . . . . . . . . . . . . . . . . . 69 133 10.2. Integrity of Authorizations . . . . . . . . . . . . . . 70 134 10.3. Denial-of-Service Considerations . . . . . . . . . . . . 73 135 10.4. Server-Side Request Forgery . . . . . . . . . . . . . . 73 136 10.5. CA Policy Considerations . . . . . . . . . . . . . . . . 74 137 11. Operational Considerations . . . . . . . . . . . . . . . . . 75 138 11.1. DNS security . . . . . . . . . . . . . . . . . . . . . . 75 139 11.2. Token Entropy . . . . . . . . . . . . . . . . . . . . . 75 140 11.3. Malformed Certificate Chains . . . . . . . . . . . . . . 75 141 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 76 142 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 76 143 13.1. Normative References . . . . . . . . . . . . . . . . . . 76 144 13.2. Informative References . . . . . . . . . . . . . . . . . 79 145 13.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 80 146 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 80 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 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 | Poll for status | GET order | 200 | 889 | | | | 890 | Finalize order | POST order finalize | 200 | 891 | | | | 892 | Poll for status | GET order | 200 | 893 | | | | 894 | Download certificate | GET order certificate | 200 | 895 +-----------------------+--------------------------+----------------+ 897 The remainder of this section provides the details of how these 898 resources are structured and how the ACME protocol makes use of them. 900 7.1.1. Directory 902 In order to help clients configure themselves with the right URLs for 903 each ACME operation, ACME servers provide a directory object. This 904 should be the only URL needed to configure clients. It is a JSON 905 object, whose field names are drawn from the following table and 906 whose values are the corresponding URLs. 908 +------------+--------------------+ 909 | Field | URL in value | 910 +------------+--------------------+ 911 | newNonce | New nonce | 912 | | | 913 | newAccount | New account | 914 | | | 915 | newOrder | New order | 916 | | | 917 | newAuthz | New authorization | 918 | | | 919 | revokeCert | Revoke certificate | 920 | | | 921 | keyChange | Key change | 922 +------------+--------------------+ 924 There is no constraint on the URL of the directory except that it 925 should be different from the other ACME server resources' URLs, and 926 that it should not clash with other services. For instance: 928 o a host which functions as both an ACME and a Web server may want 929 to keep the root path "/" for an HTML "front page", and place the 930 ACME directory under the path "/acme". 932 o a host which only functions as an ACME server could place the 933 directory under the path "/". 935 If the ACME server does not implement pre-authorization 936 (Section 7.4.1) it MUST omit the "newAuthz" field of the directory. 938 The object MAY additionally contain a field "meta". If present, it 939 MUST be a JSON object; each field in the object is an item of 940 metadata relating to the service provided by the ACME server. 942 The following metadata items are defined, all of which are OPTIONAL: 944 termsOfService (optional, string): A URL identifying the current 945 terms of service. 947 website (optional, string): An HTTP or HTTPS URL locating a website 948 providing more information about the ACME server. 950 caaIdentities (optional, array of string): Each string MUST be a 951 lowercase hostname which the ACME server recognizes as referring 952 to itself for the purposes of CAA record validation as defined in 953 [RFC6844]. This allows clients to determine the correct issuer 954 domain name to use when configuring CAA records. 956 externalAccountRequired (optional, boolean): If this field is 957 present and set to "true", then the CA requires that all new- 958 account requests include an "externalAccountBinding" field 959 associating the new account with an external account. 961 Clients access the directory by sending a GET request to the 962 directory URL. 964 HTTP/1.1 200 OK 965 Content-Type: application/json 967 { 968 "newNonce": "https://example.com/acme/new-nonce", 969 "newAccount": "https://example.com/acme/new-account", 970 "newOrder": "https://example.com/acme/new-order", 971 "newAuthz": "https://example.com/acme/new-authz", 972 "revokeCert": "https://example.com/acme/revoke-cert", 973 "keyChange": "https://example.com/acme/key-change", 974 "meta": { 975 "termsOfService": "https://example.com/acme/terms/2017-5-30", 976 "website": "https://www.example.com/", 977 "caaIdentities": ["example.com"], 978 "externalAccountRequired": false 979 } 980 } 982 7.1.2. Account Objects 984 An ACME account resource represents a set of metadata associated with 985 an account. Account resources have the following structure: 987 status (required, string): The status of this account. Possible 988 values are: "valid", "deactivated", and "revoked". The value 989 "deactivated" should be used to indicate client-initiated 990 deactivation whereas "revoked" should be used to indicate server- 991 initiated deactivation. 993 contact (optional, array of string): An array of URLs that the 994 server can use to contact the client for issues related to this 995 account. For example, the server may wish to notify the client 996 about server-initiated revocation or certificate expiration. 998 termsOfServiceAgreed (optional, boolean): Including this field in a 999 new-account request, with a value of true, indicates the client's 1000 agreement with the terms of service. This field is not updateable 1001 by the client. 1003 orders (required, string): A URL from which a list of orders 1004 submitted by this account can be fetched via a GET request, as 1005 described in Section 7.1.2.1. 1007 { 1008 "status": "valid", 1009 "contact": [ 1010 "mailto:cert-admin@example.com", 1011 "mailto:admin@example.com" 1012 ], 1013 "termsOfServiceAgreed": true, 1014 "orders": "https://example.com/acme/acct/1/orders" 1015 } 1017 7.1.2.1. Orders List 1019 Each account object includes an "orders" URL from which a list of 1020 orders created by the account can be fetched via GET request. The 1021 result of the GET request MUST be a JSON object whose "orders" field 1022 is an array of URLs, each identifying an order belonging to the 1023 account. The server SHOULD include pending orders, and SHOULD NOT 1024 include orders that are invalid in the array of URLs. The server MAY 1025 return an incomplete list, along with a Link header with a "next" 1026 link relation indicating where further entries can be acquired. 1028 HTTP/1.1 200 OK 1029 Content-Type: application/json 1030 Link: ;rel="next" 1032 { 1033 "orders": [ 1034 "https://example.com/acme/acct/1/order/1", 1035 "https://example.com/acme/acct/1/order/2", 1036 /* 47 more URLs not shown for example brevity */ 1037 "https://example.com/acme/acct/1/order/50" 1038 ] 1039 } 1041 7.1.3. Order Objects 1043 An ACME order object represents a client's request for a certificate 1044 and is used to track the progress of that order through to issuance. 1045 Thus, the object contains information about the requested 1046 certificate, the authorizations that the server requires the client 1047 to complete, and any certificates that have resulted from this order. 1049 status (required, string): The status of this order. Possible 1050 values are: "pending", "ready", "processing", "valid", and 1051 "invalid". 1053 expires (optional, string): The timestamp after which the server 1054 will consider this order invalid, encoded in the format specified 1055 in RFC 3339 [RFC3339]. This field is REQUIRED for objects with 1056 "pending" or "valid" in the status field. 1058 identifiers (required, array of object): An array of identifier 1059 objects that the order pertains to. 1061 type (required, string): The type of identifier. 1063 value (required, string): The identifier itself. 1065 notBefore (optional, string): The requested value of the notBefore 1066 field in the certificate, in the date format defined in [RFC3339]. 1068 notAfter (optional, string): The requested value of the notAfter 1069 field in the certificate, in the date format defined in [RFC3339]. 1071 error (optional, object): The error that occurred while processing 1072 the order, if any. This field is structured as a problem document 1073 [RFC7807]. 1075 authorizations (required, array of string): For pending orders, the 1076 authorizations that the client needs to complete before the 1077 requested certificate can be issued (see Section 7.5). For final 1078 orders (in the "valid" or "invalid" state), the authorizations 1079 that were completed. Each entry is a URL from which an 1080 authorization can be fetched with a GET request. 1082 finalize (required, string): A URL that a CSR must be POSTed to once 1083 all of the order's authorizations are satisfied to finalize the 1084 order. The result of a successful finalization will be the 1085 population of the certificate URL for the order. 1087 certificate (optional, string): A URL for the certificate that has 1088 been issued in response to this order. 1090 { 1091 "status": "valid", 1092 "expires": "2015-03-01T14:09:00Z", 1094 "identifiers": [ 1095 { "type": "dns", "value": "example.com" }, 1096 { "type": "dns", "value": "www.example.com" } 1097 ], 1099 "notBefore": "2016-01-01T00:00:00Z", 1100 "notAfter": "2016-01-08T00:00:00Z", 1102 "authorizations": [ 1103 "https://example.com/acme/authz/1234", 1104 "https://example.com/acme/authz/2345" 1105 ], 1107 "finalize": "https://example.com/acme/acct/1/order/1/finalize", 1109 "certificate": "https://example.com/acme/cert/1234" 1110 } 1112 Any identifier of type "dns" in a new-order request MAY have a 1113 wildcard domain name as its value. A wildcard domain name consists 1114 of a single asterisk character followed by a single full stop 1115 character ("*.") followed by a domain name as defined for use in the 1116 Subject Alternate Name Extension by RFC 5280 [RFC5280]. An 1117 authorization returned by the server for a wildcard domain name 1118 identifier MUST NOT include the asterisk and full stop ("*.") prefix 1119 in the authorization identifier value. The returned authorization 1120 MUST include the optional "wildcard" field, with a value of true. 1122 The elements of the "authorizations" and "identifiers" array are 1123 immutable once set. The server MUST NOT change the contents of 1124 either array after they are created. If a client observes a change 1125 in the contents of either array, then it SHOULD consider the order 1126 invalid. 1128 The "authorizations" array of the order SHOULD reflect all 1129 authorizations that the CA takes into account in deciding to issue, 1130 even if some authorizations were fulfilled in earlier orders or in 1131 pre-authorization transactions. For example, if a CA allows multiple 1132 orders to be fulfilled based on a single authorization transaction, 1133 then it SHOULD reflect that authorization in all of the orders. 1135 7.1.4. Authorization Objects 1137 An ACME authorization object represents a server's authorization for 1138 an account to represent an identifier. In addition to the 1139 identifier, an authorization includes several metadata fields, such 1140 as the status of the authorization (e.g., "pending", "valid", or 1141 "revoked") and which challenges were used to validate possession of 1142 the identifier. 1144 The structure of an ACME authorization resource is as follows: 1146 identifier (required, object): The identifier that the account is 1147 authorized to represent 1149 type (required, string): The type of identifier. 1151 value (required, string): The identifier itself. 1153 status (required, string): The status of this authorization. 1154 Possible values are: "pending", "valid", "invalid", "deactivated", 1155 "expired", and "revoked". 1157 expires (optional, string): The timestamp after which the server 1158 will consider this authorization invalid, encoded in the format 1159 specified in RFC 3339 [RFC3339]. This field is REQUIRED for 1160 objects with "valid" in the "status" field. 1162 challenges (required, array of objects): For pending authorizations, 1163 the challenges that the client can fulfill in order to prove 1164 possession of the identifier. For final authorizations (in the 1165 "valid" or "invalid" state), the challenges that were used. Each 1166 array entry is an object with parameters required to validate the 1167 challenge. A client should attempt to fulfill one of these 1168 challenges, and a server should consider any one of the challenges 1169 sufficient to make the authorization valid. For final 1170 authorizations, it contains the challenges that were successfully 1171 completed. 1173 wildcard (optional, boolean): For authorizations created as a result 1174 of a newOrder request containing a DNS identifier with a value 1175 that contained a wildcard prefix this field MUST be present, and 1176 true. 1178 The only type of identifier defined by this specification is a fully- 1179 qualified domain name (type: "dns"). If a domain name contains non- 1180 ASCII Unicode characters it MUST be encoded using the rules defined 1181 in [RFC3492]. Servers MUST verify any identifier values that begin 1182 with the ASCII Compatible Encoding prefix "xn--" as defined in 1184 [RFC5890] are properly encoded. Wildcard domain names (with "*" as 1185 the first label) MUST NOT be included in authorization objects. If 1186 an authorization object conveys authorization for the base domain of 1187 a newOrder DNS type identifier with a wildcard prefix then the 1188 optional authorizations "wildcard" field MUST be present with a value 1189 of true. 1191 Section 8 describes a set of challenges for domain name validation. 1193 { 1194 "status": "valid", 1195 "expires": "2015-03-01T14:09:00Z", 1197 "identifier": { 1198 "type": "dns", 1199 "value": "example.org" 1200 }, 1202 "challenges": [ 1203 { 1204 "url": "https://example.com/acme/authz/1234/0", 1205 "type": "http-01", 1206 "status": "valid", 1207 "token": "DGyRejmCefe7v4NfDGDKfA", 1208 "validated": "2014-12-01T12:05:00Z" 1209 } 1210 ], 1212 "wildcard": false 1213 } 1215 7.1.5. Challenge Objects 1217 An ACME challenge object represents a server's offer to validate a 1218 client's possession of an identifier in a specific way. Unlike the 1219 other objects listed above, there is not a single standard structure 1220 for a challenge object. The contents of a challenge object depend on 1221 the validation method being used. The general structure of challenge 1222 objects and an initial set of validation methods are described in 1223 Section 8. 1225 7.1.6. Status Changes 1227 Each ACME object type goes through a simple state machine over its 1228 lifetime. The "status" field of the object indicates which state the 1229 object is currently in. 1231 Challenge objects are created in the "pending" state. They 1232 transition to the "processing" state when the client responds to the 1233 challenge (see Section 7.5.1) and the server begins attempting to 1234 validate that the client has completed the challenge. Note that 1235 within the "processing" state, the server may attempt to validate the 1236 challenge multiple times (see Section 8.2). Likewise, client 1237 requests for retries do not cause a state change. If validation is 1238 successful, the challenge moves to the "valid" state; if there is an 1239 error, the challenge moves to the "invalid" state. 1241 pending 1242 | 1243 | Receive 1244 | response 1245 V 1246 processing <-+ 1247 | | | Server retry or 1248 | | | client retry request 1249 | +----+ 1250 | 1251 | 1252 Successful | Failed 1253 validation | validation 1254 +---------+---------+ 1255 | | 1256 V V 1257 valid invalid 1259 Authorization objects are created in the "pending" state. If one of 1260 the challenges listed in the authorization transitions to the "valid" 1261 state, then the authorization also changes to the "valid" state. If 1262 there is an error while the authorization is still pending, then the 1263 authorization transitions to the "invalid" state. Once the 1264 authorization is in the valid state, it can expire ("expired"), be 1265 deactivated by the client ("deactivated", see Section 7.5.2), or 1266 revoked by the server ("revoked"). 1268 pending --------------------+ 1269 | | 1270 | | 1271 Error | Challenge valid | 1272 +---------+---------+ | 1273 | | | 1274 V V | 1275 invalid valid | 1276 | | 1277 | | 1278 | | 1279 +--------------+--------------+ 1280 | | | 1281 | | | 1282 Server | Client | Time after | 1283 revoke | deactivate | "expires" | 1284 V V V 1285 revoked deactivated expired 1287 Order objects are created in the "pending" state. Once all of the 1288 authorizations listed in the order object are in the "valid" state, 1289 the order transitions to the "ready" state. The order moves to the 1290 "processing" state after the client submits a request to the order's 1291 "finalize" URL and the CA begins the issuance process for the 1292 certificate. Once the certificate is issued, the order enters the 1293 "valid" state. If an error occurs at any of these stages, the order 1294 moves to the "invalid" state. The order also moves to the "invalid" 1295 state if it expires, or one of its authorizations enters a final 1296 state other than "valid" ("expired", "revoked", "deactivated"). 1298 pending --------------+ 1299 | | 1300 | All authz | 1301 | "valid" | 1302 V | 1303 ready ---------------+ 1304 | | 1305 | Receive | 1306 | finalize | 1307 | request | 1308 V | 1309 processing ------------+ 1310 | | 1311 | Certificate | Error or 1312 | issued | Authorization failure 1313 V V 1314 valid invalid 1316 Account objects are created in the "valid" state, since no further 1317 action is required to create an account after a successful newAccount 1318 request. If the account is deactivated by the client or revoked by 1319 the server, it moves to the corresponding state. 1321 valid 1322 | 1323 | 1324 +-----------+-----------+ 1325 Client | Server | 1326 deactiv.| revoke | 1327 V V 1328 deactivated revoked 1330 Note that some of these states may not ever appear in a "status" 1331 field, depending on server behavior. For example, a server that 1332 issues synchronously will never show an order in the "processing" 1333 state. A server that deletes expired authorizations immediately will 1334 never show an authorization in the "expired" state. 1336 7.2. Getting a Nonce 1338 Before sending a POST request to the server, an ACME client needs to 1339 have a fresh anti-replay nonce to put in the "nonce" header of the 1340 JWS. In most cases, the client will have gotten a nonce from a 1341 previous request. However, the client might sometimes need to get a 1342 new nonce, e.g., on its first request to the server or if an existing 1343 nonce is no longer valid. 1345 To get a fresh nonce, the client sends a HEAD request to the new- 1346 nonce resource on the server. The server's response MUST include a 1347 Replay-Nonce header field containing a fresh nonce, and SHOULD have 1348 status code 200 (OK). The server SHOULD also respond to GET requests 1349 for this resource, returning an empty body (while still providing a 1350 Replay-Nonce header) with a 204 (No Content) status. 1352 HEAD /acme/new-nonce HTTP/1.1 1353 Host: example.com 1355 HTTP/1.1 200 OK 1356 Replay-Nonce: oFvnlFP1wIhRlYS2jTaXbA 1357 Cache-Control: no-store 1359 Proxy caching of responses from the new-nonce resource can cause 1360 clients receive the same nonce repeatedly, leading to badNonce 1361 errors. The server MUST include a Cache-Control header field with 1362 the "no-store" directive in responses for the new-nonce resource, in 1363 order to prevent caching of this resource. 1365 7.3. Account Creation 1367 A client creates a new account with the server by sending a POST 1368 request to the server's new-account URL. The body of the request is 1369 a stub account object optionally containing the "contact" and 1370 "termsOfServiceAgreed" fields. 1372 contact (optional, array of string): Same meaning as the 1373 corresponding server field defined in Section 7.1.2 1375 termsOfServiceAgreed (optional, boolean): Same meaning as the 1376 corresponding server field defined in Section 7.1.2 1378 onlyReturnExisting (optional, boolean): If this field is present 1379 with the value "true", then the server MUST NOT create a new 1380 account if one does not already exist. This allows a client to 1381 look up an account URL based on an account key (see 1382 Section 7.3.1). 1384 externalAccountBinding (optional, object): An optional field for 1385 binding the new account with an existing non-ACME account (see 1386 Section 7.3.5). 1388 POST /acme/new-account HTTP/1.1 1389 Host: example.com 1390 Content-Type: application/jose+json 1392 { 1393 "protected": base64url({ 1394 "alg": "ES256", 1395 "jwk": {...}, 1396 "nonce": "6S8IqOGY7eL2lsGoTZYifg", 1397 "url": "https://example.com/acme/new-account" 1398 }), 1399 "payload": base64url({ 1400 "termsOfServiceAgreed": true, 1401 "contact": [ 1402 "mailto:cert-admin@example.com", 1403 "mailto:admin@example.com" 1404 ] 1405 }), 1406 "signature": "RZPOnYoPs1PhjszF...-nh6X1qtOFPB519I" 1407 } 1409 The server MUST ignore any values provided in the "orders" fields in 1410 account bodies sent by the client, as well as any other fields that 1411 it does not recognize. If new fields are specified in the future, 1412 the specification of those fields MUST describe whether they can be 1413 provided by the client. 1415 In general, the server MUST ignore any fields in the request object 1416 that it does not recognize. In particular, it MUST NOT reflect 1417 unrecognized fields in the resulting account object. This allows 1418 clients to detect when servers do not support an extension field. 1420 The server SHOULD validate that the contact URLs in the "contact" 1421 field are valid and supported by the server. If the server validates 1422 contact URLs it MUST support the "mailto" scheme. Clients MUST NOT 1423 provide a "mailto" URL in the "contact" field that contains "hfields" 1424 [RFC6068], or more than one "addr-spec" in the "to" component. If a 1425 server encounters a "mailto" contact URL that does not meet these 1426 criteria, then it SHOULD reject it as invalid. 1428 If the server rejects a contact URL for using an unsupported scheme 1429 it MUST return an error of type "unsupportedContact", with a 1430 description describing the error and what types of contact URLs the 1431 server considers acceptable. If the server rejects a contact URL for 1432 using a supported scheme but an invalid value then the server MUST 1433 return an error of type "invalidContact". 1435 If the server wishes to present the client with terms under which the 1436 ACME service is to be used, it MUST indicate the URL where such terms 1437 can be accessed in the "termsOfService" subfield of the "meta" field 1438 in the directory object, and the server MUST reject new-account 1439 requests that do not have the "termsOfServiceAgreed" field set to 1440 "true". Clients SHOULD NOT automatically agree to terms by default. 1441 Rather, they SHOULD require some user interaction for agreement to 1442 terms. 1444 The server creates an account and stores the public key used to 1445 verify the JWS (i.e., the "jwk" element of the JWS header) to 1446 authenticate future requests from the account. The server returns 1447 this account object in a 201 (Created) response, with the account URL 1448 in a Location header field. The account URL is used as the "kid" 1449 value in the JWS authenticating subsequent requests by this account 1450 (See Section 6.2). 1452 HTTP/1.1 201 Created 1453 Content-Type: application/json 1454 Replay-Nonce: D8s4D2mLs8Vn-goWuPQeKA 1455 Location: https://example.com/acme/acct/1 1456 Link: ;rel="index" 1458 { 1459 "status": "valid", 1461 "contact": [ 1462 "mailto:cert-admin@example.com", 1463 "mailto:admin@example.com" 1464 ], 1466 "orders": "https://example.com/acme/acct/1/orders" 1467 } 1469 7.3.1. Finding an Account URL Given a Key 1471 If the server already has an account registered with the provided 1472 account key, then it MUST return a response with a 200 (OK) status 1473 code and provide the URL of that account in the Location header 1474 field. This allows a client that has an account key but not the 1475 corresponding account URL to recover the account URL. 1477 If a client wishes to find the URL for an existing account and does 1478 not want an account to be created if one does not already exist, then 1479 it SHOULD do so by sending a POST request to the new-account URL with 1480 a JWS whose payload has an "onlyReturnExisting" field set to "true" 1481 ({"onlyReturnExisting": true}). If a client sends such a request and 1482 an account does not exist, then the server MUST return an error 1483 response with status code 400 (Bad Request) and type 1484 "urn:ietf:params:acme:error:accountDoesNotExist". 1486 7.3.2. Account Update 1488 If the client wishes to update this information in the future, it 1489 sends a POST request with updated information to the account URL. 1490 The server MUST ignore any updates to the "orders" field or any other 1491 fields it does not recognize. If the server accepts the update, it 1492 MUST return a response with a 200 (OK) status code and the resulting 1493 account object. 1495 For example, to update the contact information in the above account, 1496 the client could send the following request: 1498 POST /acme/acct/1 HTTP/1.1 1499 Host: example.com 1500 Content-Type: application/jose+json 1502 { 1503 "protected": base64url({ 1504 "alg": "ES256", 1505 "kid": "https://example.com/acme/acct/1", 1506 "nonce": "ax5RnthDqp_Yf4_HZnFLmA", 1507 "url": "https://example.com/acme/acct/1" 1508 }), 1509 "payload": base64url({ 1510 "contact": [ 1511 "mailto:certificates@example.com", 1512 "mailto:admin@example.com" 1513 ] 1514 }), 1515 "signature": "hDXzvcj8T6fbFbmn...rDzXzzvzpRy64N0o" 1516 } 1518 7.3.3. Account Information 1520 Servers MUST NOT respond to GET requests for account resources as 1521 these requests are not authenticated. If a client wishes to query 1522 the server for information about its account (e.g., to examine the 1523 "contact" or "orders" fields), then it SHOULD do so by sending a POST 1524 request with an empty update. That is, it should send a JWS whose 1525 payload is an empty object ({}). 1527 7.3.4. Changes of Terms of Service 1529 As described above, a client can indicate its agreement with the CA's 1530 terms of service by setting the "termsOfServiceAgreed" field in its 1531 account object to "true". 1533 If the server has changed its terms of service since a client 1534 initially agreed, and the server is unwilling to process a request 1535 without explicit agreement to the new terms, then it MUST return an 1536 error response with status code 403 (Forbidden) and type 1537 "urn:ietf:params:acme:error:userActionRequired". This response MUST 1538 include a Link header with link relation "terms-of-service" and the 1539 latest terms-of-service URL. 1541 The problem document returned with the error MUST also include an 1542 "instance" field, indicating a URL that the client should direct a 1543 human user to visit in order for instructions on how to agree to the 1544 terms. 1546 HTTP/1.1 403 Forbidden 1547 Replay-Nonce: IXVHDyxIRGcTE0VSblhPzw 1548 Link: ;rel="terms-of-service" 1549 Content-Type: application/problem+json 1550 Content-Language: en 1552 { 1553 "type": "urn:ietf:params:acme:error:userActionRequired", 1554 "detail": "Terms of service have changed", 1555 "instance": "https://example.com/acme/agreement/?token=W8Ih3PswD-8" 1556 } 1558 7.3.5. External Account Binding 1560 The server MAY require a value for the "externalAccountBinding" field 1561 to be present in "newAccount" requests. This can be used to 1562 associate an ACME account with an existing account in a non-ACME 1563 system, such as a CA customer database. 1565 To enable ACME account binding, a CA needs to provide the ACME client 1566 with a MAC key and a key identifier, using some mechanism outside of 1567 ACME. The key identifier MUST be an ASCII string. The MAC key 1568 SHOULD be provided in base64url-encoded form, to maximize 1569 compatibility between non-ACME provisioning systems and ACME clients. 1571 The ACME client then computes a binding JWS to indicate the external 1572 account holder's approval of the ACME account key. The payload of 1573 this JWS is the account key being registered, in JWK form. The 1574 protected header of the JWS MUST meet the following criteria: 1576 o The "alg" field MUST indicate a MAC-based algorithm 1578 o The "kid" field MUST contain the key identifier provided by the CA 1580 o The "nonce" field MUST NOT be present 1582 o The "url" field MUST be set to the same value as the outer JWS 1584 The "signature" field of the JWS will contain the MAC value computed 1585 with the MAC key provided by the CA. 1587 POST /acme/new-account HTTP/1.1 1588 Host: example.com 1589 Content-Type: application/jose+json 1591 { 1592 "protected": base64url({ 1593 "alg": "ES256", 1594 "jwk": /* account key */, 1595 "nonce": "K60BWPrMQG9SDxBDS_xtSw", 1596 "url": "https://example.com/acme/new-account" 1597 }), 1598 "payload": base64url({ 1599 "contact": ["mailto:example@anonymous.invalid"], 1600 "termsOfServiceAgreed": true, 1602 "externalAccountBinding": { 1603 "protected": base64url({ 1604 "alg": "HS256", 1605 "kid": /* key identifier from CA */, 1606 "url": "https://example.com/acme/new-account" 1607 }), 1608 "payload": base64url(/* same as in "jwk" above */), 1609 "signature": /* MAC using MAC key from CA */ 1610 } 1611 }), 1612 "signature": "5TWiqIYQfIDfALQv...x9C2mg8JGPxl5bI4" 1613 } 1615 If a CA requires that new-account requests contain an 1616 "externalAccountBinding" field, then it MUST provide the value "true" 1617 in the "externalAccountRequired" subfield of the "meta" field in the 1618 directory object. If the CA receives a new-account request without 1619 an "externalAccountBinding" field, then it SHOULD reply with an error 1620 of type "externalAccountRequired". 1622 When a CA receives a new-account request containing an 1623 "externalAccountBinding" field, it decides whether or not to verify 1624 the binding. If the CA does not verify the binding, then it MUST NOT 1625 reflect the "externalAccountBinding" field in the resulting account 1626 object (if any). To verify the account binding, the CA MUST take the 1627 following steps: 1629 1. Verify that the value of the field is a well-formed JWS 1631 2. Verify that the JWS protected field meets the above criteria 1633 3. Retrieve the MAC key corresponding to the key identifier in the 1634 "kid" field 1636 4. Verify that the MAC on the JWS verifies using that MAC key 1638 5. Verify that the payload of the JWS represents the same key as was 1639 used to verify the outer JWS (i.e., the "jwk" field of the outer 1640 JWS) 1642 If all of these checks pass and the CA creates a new account, then 1643 the CA may consider the new account associated with the external 1644 account corresponding to the MAC key and MUST reflect the value of 1645 the "externalAccountBinding" field in the resulting account object. 1646 If any of these checks fail, then the CA MUST reject the new-account 1647 request. 1649 7.3.6. Account Key Roll-over 1651 A client may wish to change the public key that is associated with an 1652 account in order to recover from a key compromise or proactively 1653 mitigate the impact of an unnoticed key compromise. 1655 To change the key associated with an account, the client first 1656 constructs a key-change object describing the change that it would 1657 like the server to make: 1659 account (required, string): The URL for the account being modified. 1660 The content of this field MUST be the exact string provided in the 1661 Location header field in response to the new-account request that 1662 created the account. 1664 newKey (required, JWK): The JWK representation of the new key 1666 The client then encapsulates the key-change object in an "inner" JWS, 1667 signed with the requested new account key (i.e., the key matching the 1668 "newKey" value). This JWS then becomes the payload for the "outer" 1669 JWS that is the body of the ACME request. 1671 The outer JWS MUST meet the normal requirements for an ACME JWS (see 1672 Section 6.2). The inner JWS MUST meet the normal requirements, with 1673 the following differences: 1675 o The inner JWS MUST have a "jwk" header parameter, containing the 1676 public key of the new key pair (i.e., the same value as the 1677 "newKey" field). 1679 o The inner JWS MUST have the same "url" header parameter as the 1680 outer JWS. 1682 o The inner JWS is NOT REQUIRED to have a "nonce" header parameter. 1683 The server MUST ignore any value provided for the "nonce" header 1684 parameter. 1686 This transaction has signatures from both the old and new keys so 1687 that the server can verify that the holders of the two keys both 1688 agree to the change. The signatures are nested to preserve the 1689 property that all signatures on POST messages are signed by exactly 1690 one key. 1692 POST /acme/key-change HTTP/1.1 1693 Host: example.com 1694 Content-Type: application/jose+json 1696 { 1697 "protected": base64url({ 1698 "alg": "ES256", 1699 "kid": "https://example.com/acme/acct/1", 1700 "nonce": "K60BWPrMQG9SDxBDS_xtSw", 1701 "url": "https://example.com/acme/key-change" 1702 }), 1703 "payload": base64url({ 1704 "protected": base64url({ 1705 "alg": "ES256", 1706 "jwk": /* new key */, 1707 "url": "https://example.com/acme/key-change" 1708 }), 1709 "payload": base64url({ 1710 "account": "https://example.com/acme/acct/1", 1711 "newKey": /* new key */ 1712 }), 1713 "signature": "Xe8B94RD30Azj2ea...8BmZIRtcSKPSd8gU" 1714 }), 1715 "signature": "5TWiqIYQfIDfALQv...x9C2mg8JGPxl5bI4" 1716 } 1718 On receiving key-change request, the server MUST perform the 1719 following steps in addition to the typical JWS validation: 1721 1. Validate the POST request belongs to a currently active account, 1722 as described in Section 6. 1724 2. Check that the payload of the JWS is a well-formed JWS object 1725 (the "inner JWS"). 1727 3. Check that the JWS protected header of the inner JWS has a "jwk" 1728 field. 1730 4. Check that the inner JWS verifies using the key in its "jwk" 1731 field. 1733 5. Check that the payload of the inner JWS is a well-formed key- 1734 change object (as described above). 1736 6. Check that the "url" parameters of the inner and outer JWSs are 1737 the same. 1739 7. Check that the "account" field of the key-change object contains 1740 the URL for the account matching the old key. 1742 8. Check that the "newKey" field of the key-change object also 1743 verifies the inner JWS. 1745 9. Check that no account exists whose account key is the same as the 1746 key in the "newKey" field. 1748 If all of these checks pass, then the server updates the 1749 corresponding account by replacing the old account key with the new 1750 public key and returns status code 200 (OK). Otherwise, the server 1751 responds with an error status code and a problem document describing 1752 the error. If there is an existing account with the new key 1753 provided, then the server SHOULD use status code 409 (Conflict) and 1754 provide the URL of that account in the Location header field. 1756 Note that changing the account key for an account SHOULD NOT have any 1757 other impact on the account. For example, the server MUST NOT 1758 invalidate pending orders or authorization transactions based on a 1759 change of account key. 1761 7.3.7. Account Deactivation 1763 A client can deactivate an account by posting a signed update to the 1764 server with a status field of "deactivated." Clients may wish to do 1765 this when the account key is compromised or decommissioned. 1767 POST /acme/acct/1 HTTP/1.1 1768 Host: example.com 1769 Content-Type: application/jose+json 1771 { 1772 "protected": base64url({ 1773 "alg": "ES256", 1774 "kid": "https://example.com/acme/acct/1", 1775 "nonce": "ntuJWWSic4WVNSqeUmshgg", 1776 "url": "https://example.com/acme/acct/1" 1777 }), 1778 "payload": base64url({ 1779 "status": "deactivated" 1780 }), 1781 "signature": "earzVLd3m5M4xJzR...bVTqn7R08AKOVf3Y" 1782 } 1784 The server MUST verify that the request is signed by the account key. 1785 If the server accepts the deactivation request, it replies with a 200 1786 (OK) status code and the current contents of the account object. 1788 Once an account is deactivated, the server MUST NOT accept further 1789 requests authorized by that account's key. The server SHOULD cancel 1790 any pending operations authorized by the account's key, such as 1791 certificate orders. A server may take a variety of actions in 1792 response to an account deactivation, e.g., deleting data related to 1793 that account or sending mail to the account's contacts. Servers 1794 SHOULD NOT revoke certificates issued by the deactivated account, 1795 since this could cause operational disruption for servers using these 1796 certificates. ACME does not provide a way to reactivate a 1797 deactivated account. 1799 7.4. Applying for Certificate Issuance 1801 The client requests certificate issuance by sending a POST request to 1802 the server's new-order resource. The body of the POST is a JWS 1803 object whose JSON payload is a subset of the order object defined in 1804 Section 7.1.3, containing the fields that describe the certificate to 1805 be issued: 1807 identifiers (required, array of object): An array of identifier 1808 objects that the client wishes to submit an order for. 1810 type (required, string): The type of identifier. 1812 value (required, string): The identifier itself. 1814 notBefore (optional, string): The requested value of the notBefore 1815 field in the certificate, in the date format defined in [RFC3339]. 1817 notAfter (optional, string): The requested value of the notAfter 1818 field in the certificate, in the date format defined in [RFC3339]. 1820 POST /acme/new-order HTTP/1.1 1821 Host: example.com 1822 Content-Type: application/jose+json 1824 { 1825 "protected": base64url({ 1826 "alg": "ES256", 1827 "kid": "https://example.com/acme/acct/1", 1828 "nonce": "5XJ1L3lEkMG7tR6pA00clA", 1829 "url": "https://example.com/acme/new-order" 1830 }), 1831 "payload": base64url({ 1832 "identifiers": [ 1833 { "type": "dns", "value": "example.com" } 1834 ], 1835 "notBefore": "2016-01-01T00:00:00Z", 1836 "notAfter": "2016-01-08T00:00:00Z" 1837 }), 1838 "signature": "H6ZXtGjTZyUnPeKn...wEA4TklBdh3e454g" 1839 } 1841 The server MUST return an error if it cannot fulfill the request as 1842 specified, and MUST NOT issue a certificate with contents other than 1843 those requested. If the server requires the request to be modified 1844 in a certain way, it should indicate the required changes using an 1845 appropriate error type and description. 1847 If the server is willing to issue the requested certificate, it 1848 responds with a 201 (Created) response. The body of this response is 1849 an order object reflecting the client's request and any 1850 authorizations the client must complete before the certificate will 1851 be issued. 1853 HTTP/1.1 201 Created 1854 Replay-Nonce: MYAuvOpaoIiywTezizk5vw 1855 Location: https://example.com/acme/order/asdf 1857 { 1858 "status": "pending", 1859 "expires": "2016-01-01T00:00:00Z", 1861 "notBefore": "2016-01-01T00:00:00Z", 1862 "notAfter": "2016-01-08T00:00:00Z", 1864 "identifiers": [ 1865 { "type": "dns", "value": "example.com" }, 1866 { "type": "dns", "value": "www.example.com" } 1867 ], 1869 "authorizations": [ 1870 "https://example.com/acme/authz/1234", 1871 "https://example.com/acme/authz/2345" 1872 ], 1874 "finalize": "https://example.com/acme/order/asdf/finalize" 1875 } 1877 The order object returned by the server represents a promise that if 1878 the client fulfills the server's requirements before the "expires" 1879 time, then the server will be willing to finalize the order upon 1880 request and issue the requested certificate. In the order object, 1881 any authorization referenced in the "authorizations" array whose 1882 status is "pending" represents an authorization transaction that the 1883 client must complete before the server will issue the certificate 1884 (see Section 7.5). If the client fails to complete the required 1885 actions before the "expires" time, then the server SHOULD change the 1886 status of the order to "invalid" and MAY delete the order resource. 1888 Once the client believes it has fulfilled the server's requirements, 1889 it should send a POST request to the order resource's finalize URL. 1890 The POST body MUST include a CSR: 1892 csr (required, string): A CSR encoding the parameters for the 1893 certificate being requested [RFC2986]. The CSR is sent in the 1894 base64url-encoded version of the DER format. (Note: Because this 1895 field uses base64url, and does not include headers, it is 1896 different from PEM.). 1898 POST /acme/order/asdf/finalize HTTP/1.1 1899 Host: example.com 1900 Content-Type: application/jose+json 1902 { 1903 "protected": base64url({ 1904 "alg": "ES256", 1905 "kid": "https://example.com/acme/acct/1", 1906 "nonce": "MSF2j2nawWHPxxkE3ZJtKQ", 1907 "url": "https://example.com/acme/order/asdf/finalize" 1908 }), 1909 "payload": base64url({ 1910 "csr": "MIIBPTCBxAIBADBFMQ...FS6aKdZeGsysoCo4H9P", 1911 }), 1912 "signature": "uOrUfIIk5RyQ...nw62Ay1cl6AB" 1913 } 1915 The CSR encodes the client's requests with regard to the content of 1916 the certificate to be issued. The CSR MUST indicate the exact same 1917 set of requested identifiers as the initial new-order request, either 1918 in the commonName portion of the requested subject name, or in an 1919 extensionRequest attribute [RFC2985] requesting a subjectAltName 1920 extension. 1922 A request to finalize an order will result in error if the order 1923 indicated does not have status "ready", if the CSR and order 1924 identifiers differ, or if the account is not authorized for the 1925 identifiers indicated in the CSR. 1927 A valid request to finalize an order will return the order to be 1928 finalized. The client should begin polling the order by sending a 1929 GET request to the order resource to obtain its current state. The 1930 status of the order will indicate what action the client should take: 1932 o "invalid": The certificate will not be issued. Consider this 1933 order process abandoned. 1935 o "pending": The server does not believe that the client has 1936 fulfilled the requirements. Check the "authorizations" array for 1937 entries that are still pending. 1939 o "ready": The server agrees that the requirements have been 1940 fulfilled, and is awaiting finalization. Submit a finalization 1941 request. 1943 o "processing": The certificate is being issued. Send a GET request 1944 after the time given in the "Retry-After" header field of the 1945 response, if any. 1947 o "valid": The server has issued the certificate and provisioned its 1948 URL to the "certificate" field of the order. Download the 1949 certificate. 1951 HTTP/1.1 200 OK 1952 Replay-Nonce: CGf81JWBsq8QyIgPCi9Q9X 1953 Location: https://example.com/acme/order/asdf 1955 { 1956 "status": "valid", 1957 "expires": "2016-01-01T00:00:00Z", 1959 "notBefore": "2016-01-01T00:00:00Z", 1960 "notAfter": "2016-01-08T00:00:00Z", 1962 "identifiers": [ 1963 { "type": "dns", "value": "example.com" }, 1964 { "type": "dns", "value": "www.example.com" } 1965 ], 1967 "authorizations": [ 1968 "https://example.com/acme/authz/1234", 1969 "https://example.com/acme/authz/2345" 1970 ], 1972 "finalize": "https://example.com/acme/order/asdf/finalize", 1974 "certificate": "https://example.com/acme/cert/asdf" 1975 } 1977 7.4.1. Pre-Authorization 1979 The order process described above presumes that authorization objects 1980 are created reactively, in response to a certificate order. Some 1981 servers may also wish to enable clients to obtain authorization for 1982 an identifier proactively, outside of the context of a specific 1983 issuance. For example, a client hosting virtual servers for a 1984 collection of names might wish to obtain authorization before any 1985 virtual servers are created and only create a certificate when a 1986 virtual server starts up. 1988 In some cases, a CA running an ACME server might have a completely 1989 external, non-ACME process for authorizing a client to issue 1990 certificates for an identifier. In these cases, the CA should 1991 provision its ACME server with authorization objects corresponding to 1992 these authorizations and reflect them as already valid in any orders 1993 submitted by the client. 1995 If a CA wishes to allow pre-authorization within ACME, it can offer a 1996 "new authorization" resource in its directory by adding the field 1997 "newAuthz" with a URL for the new authorization resource. 1999 To request authorization for an identifier, the client sends a POST 2000 request to the new-authorization resource specifying the identifier 2001 for which authorization is being requested. 2003 identifier (required, object): The identifier to appear in the 2004 resulting authorization object (see Section 7.1.4) 2006 POST /acme/new-authz HTTP/1.1 2007 Host: example.com 2008 Content-Type: application/jose+json 2010 { 2011 "protected": base64url({ 2012 "alg": "ES256", 2013 "kid": "https://example.com/acme/acct/1", 2014 "nonce": "uQpSjlRb4vQVCjVYAyyUWg", 2015 "url": "https://example.com/acme/new-authz" 2016 }), 2017 "payload": base64url({ 2018 "identifier": { 2019 "type": "dns", 2020 "value": "example.net" 2021 } 2022 }), 2023 "signature": "nuSDISbWG8mMgE7H...QyVUL68yzf3Zawps" 2024 } 2026 Note that because the identifier in a pre-authorization request is 2027 the exact identifier to be included in the authorization object, pre- 2028 authorization cannot be used to authorize issuance with wildcard DNS 2029 identifiers. 2031 Before processing the authorization request, the server SHOULD 2032 determine whether it is willing to issue certificates for the 2033 identifier. For example, the server should check that the identifier 2034 is of a supported type. Servers might also check names against a 2035 blacklist of known high-value identifiers. If the server is 2036 unwilling to issue for the identifier, it SHOULD return a 403 2037 (Forbidden) error, with a problem document describing the reason for 2038 the rejection. 2040 If the server is willing to proceed, it builds a pending 2041 authorization object from the inputs submitted by the client: 2043 o "identifier" the identifier submitted by the client 2045 o "status" MUST be "pending" unless the server has out-of-band 2046 information about the client's authorization status 2048 o "challenges" as selected by the server's policy for this 2049 identifier 2051 The server allocates a new URL for this authorization, and returns a 2052 201 (Created) response, with the authorization URL in the Location 2053 header field, and the JSON authorization object in the body. The 2054 client then follows the process described in Section 7.5 to complete 2055 the authorization process. 2057 7.4.2. Downloading the Certificate 2059 To download the issued certificate, the client simply sends a GET 2060 request to the certificate URL. 2062 The default format of the certificate is application/pem-certificate- 2063 chain (see IANA Considerations). 2065 The server MAY provide one or more link relation header fields 2066 [RFC5988] with relation "alternate". Each such field SHOULD express 2067 an alternative certificate chain starting with the same end-entity 2068 certificate. This can be used to express paths to various trust 2069 anchors. Clients can fetch these alternates and use their own 2070 heuristics to decide which is optimal. 2072 GET /acme/cert/asdf HTTP/1.1 2073 Host: example.com 2074 Accept: application/pkix-cert 2076 HTTP/1.1 200 OK 2077 Content-Type: application/pem-certificate-chain 2078 Link: ;rel="index" 2080 -----BEGIN CERTIFICATE----- 2081 [End-entity certificate contents] 2082 -----END CERTIFICATE----- 2083 -----BEGIN CERTIFICATE----- 2084 [Issuer certificate contents] 2085 -----END CERTIFICATE----- 2086 -----BEGIN CERTIFICATE----- 2087 [Other certificate contents] 2088 -----END CERTIFICATE----- 2089 A certificate resource represents a single, immutable certificate. 2090 If the client wishes to obtain a renewed certificate, the client 2091 initiates a new order process to request one. 2093 Because certificate resources are immutable once issuance is 2094 complete, the server MAY enable the caching of the resource by adding 2095 Expires and Cache-Control headers specifying a point in time in the 2096 distant future. These headers have no relation to the certificate's 2097 period of validity. 2099 The ACME client MAY request other formats by including an Accept 2100 header in its request. For example, the client could use the media 2101 type "application/pkix-cert" [RFC2585] to request the end-entity 2102 certificate in DER format. Server support for alternate formats is 2103 OPTIONAL. For formats that can only express a single certificate, 2104 the server SHOULD provide one or more "Link: rel="up"" headers 2105 pointing to an issuer or issuers so that ACME clients can build a 2106 certificate chain as defined in TLS. 2108 7.5. Identifier Authorization 2110 The identifier authorization process establishes the authorization of 2111 an account to manage certificates for a given identifier. This 2112 process assures the server of two things: 2114 1. That the client controls the private key of the account key pair, 2115 and 2117 2. That the client controls the identifier in question. 2119 This process may be repeated to associate multiple identifiers to a 2120 key pair (e.g., to request certificates with multiple identifiers), 2121 or to associate multiple accounts with an identifier (e.g., to allow 2122 multiple entities to manage certificates). 2124 Authorization resources are created by the server in response to 2125 certificate orders or authorization requests submitted by an account 2126 key holder; their URLs are provided to the client in the responses to 2127 these requests. The authorization object is implicitly tied to the 2128 account key used to sign the request. 2130 When a client receives an order from the server it downloads the 2131 authorization resources by sending GET requests to the indicated 2132 URLs. If the client initiates authorization using a request to the 2133 new authorization resource, it will have already received the pending 2134 authorization object in the response to that request. 2136 GET /acme/authz/1234 HTTP/1.1 2137 Host: example.com 2139 HTTP/1.1 200 OK 2140 Content-Type: application/json 2141 Link: ;rel="index" 2143 { 2144 "status": "pending", 2145 "expires": "2018-03-03T14:09:00Z", 2147 "identifier": { 2148 "type": "dns", 2149 "value": "example.org" 2150 }, 2152 "challenges": [ 2153 { 2154 "type": "http-01", 2155 "url": "https://example.com/acme/authz/1234/0", 2156 "token": "DGyRejmCefe7v4NfDGDKfA" 2157 }, 2158 { 2159 "type": "dns-01", 2160 "url": "https://example.com/acme/authz/1234/2", 2161 "token": "DGyRejmCefe7v4NfDGDKfA" 2162 } 2163 ], 2165 "wildcard": false 2166 } 2168 7.5.1. Responding to Challenges 2170 To prove control of the identifier and receive authorization, the 2171 client needs to respond with information to complete the challenges. 2172 To do this, the client updates the authorization object received from 2173 the server by filling in any required information in the elements of 2174 the "challenges" dictionary. 2176 The client sends these updates back to the server in the form of a 2177 JSON object with contents as specified by the challenge type, carried 2178 in a POST request to the challenge URL (not authorization URL) once 2179 it is ready for the server to attempt validation. 2181 For example, if the client were to respond to the "http-01" challenge 2182 in the above authorization, it would send the following request: 2184 POST /acme/authz/1234/0 HTTP/1.1 2185 Host: example.com 2186 Content-Type: application/jose+json 2188 { 2189 "protected": base64url({ 2190 "alg": "ES256", 2191 "kid": "https://example.com/acme/acct/1", 2192 "nonce": "Q_s3MWoqT05TrdkM2MTDcw", 2193 "url": "https://example.com/acme/authz/1234/0" 2194 }), 2195 "payload": base64url({}), 2196 "signature": "9cbg5JO1Gf5YLjjz...SpkUfcdPai9uVYYQ" 2197 } 2199 The server updates the authorization document by updating its 2200 representation of the challenge with the response object provided by 2201 the client. The server MUST ignore any fields in the response object 2202 that are not specified as response fields for this type of challenge. 2203 The server provides a 200 (OK) response with the updated challenge 2204 object as its body. 2206 If the client's response is invalid for any reason or does not 2207 provide the server with appropriate information to validate the 2208 challenge, then the server MUST return an HTTP error. On receiving 2209 such an error, the client SHOULD undo any actions that have been 2210 taken to fulfill the challenge, e.g., removing files that have been 2211 provisioned to a web server. 2213 The server is said to "finalize" the authorization when it has 2214 completed one of the validations, by assigning the authorization a 2215 status of "valid" or "invalid", corresponding to whether it considers 2216 the account authorized for the identifier. If the final state is 2217 "valid", then the server MUST include an "expires" field. When 2218 finalizing an authorization, the server MAY remove challenges other 2219 than the one that was completed, and may modify the "expires" field. 2220 The server SHOULD NOT remove challenges with status "invalid". 2222 Usually, the validation process will take some time, so the client 2223 will need to poll the authorization resource to see when it is 2224 finalized. For challenges where the client can tell when the server 2225 has validated the challenge (e.g., by seeing an HTTP or DNS request 2226 from the server), the client SHOULD NOT begin polling until it has 2227 seen the validation request from the server. 2229 To check on the status of an authorization, the client sends a GET 2230 request to the authorization URL, and the server responds with the 2231 current authorization object. In responding to poll requests while 2232 the validation is still in progress, the server MUST return a 200 2233 (OK) response and MAY include a Retry-After header field to suggest a 2234 polling interval to the client. 2236 GET /acme/authz/1234 HTTP/1.1 2237 Host: example.com 2239 HTTP/1.1 200 OK 2240 Content-Type: application/json 2242 { 2243 "status": "valid", 2244 "expires": "2018-09-09T14:09:00Z", 2246 "identifier": { 2247 "type": "dns", 2248 "value": "example.org" 2249 }, 2251 "challenges": [ 2252 { 2253 "type": "http-01", 2254 "url": "https://example.com/acme/authz/1234/0", 2255 "status": "valid", 2256 "validated": "2014-12-01T12:05:00Z", 2257 "token": "IlirfxKKXAsHtmzK29Pj8A" 2258 } 2259 ], 2261 "wildcard": false 2262 } 2264 7.5.2. Deactivating an Authorization 2266 If a client wishes to relinquish its authorization to issue 2267 certificates for an identifier, then it may request that the server 2268 deactivates each authorization associated with it by sending POST 2269 requests with the static object {"status": "deactivated"} to each 2270 authorization URL. 2272 POST /acme/authz/1234 HTTP/1.1 2273 Host: example.com 2274 Content-Type: application/jose+json 2276 { 2277 "protected": base64url({ 2278 "alg": "ES256", 2279 "kid": "https://example.com/acme/acct/1", 2280 "nonce": "xWCM9lGbIyCgue8di6ueWQ", 2281 "url": "https://example.com/acme/authz/1234" 2282 }), 2283 "payload": base64url({ 2284 "status": "deactivated" 2285 }), 2286 "signature": "srX9Ji7Le9bjszhu...WTFdtujObzMtZcx4" 2287 } 2289 The server MUST verify that the request is signed by the account key 2290 corresponding to the account that owns the authorization. If the 2291 server accepts the deactivation, it should reply with a 200 (OK) 2292 status code and the updated contents of the authorization object. 2294 The server MUST NOT treat deactivated authorization objects as 2295 sufficient for issuing certificates. 2297 7.6. Certificate Revocation 2299 To request that a certificate be revoked, the client sends a POST 2300 request to the ACME server's revokeCert URL. The body of the POST is 2301 a JWS object whose JSON payload contains the certificate to be 2302 revoked: 2304 certificate (required, string): The certificate to be revoked, in 2305 the base64url-encoded version of the DER format. (Note: Because 2306 this field uses base64url, and does not include headers, it is 2307 different from PEM.) 2309 reason (optional, int): One of the revocation reasonCodes defined in 2310 Section 5.3.1 of [RFC5280] to be used when generating OCSP 2311 responses and CRLs. If this field is not set the server SHOULD 2312 omit the reasonCode CRL entry extension when generating OCSP 2313 responses and CRLs. The server MAY disallow a subset of 2314 reasonCodes from being used by the user. If a request contains a 2315 disallowed reasonCode the server MUST reject it with the error 2316 type "urn:ietf:params:acme:error:badRevocationReason". The 2317 problem document detail SHOULD indicate which reasonCodes are 2318 allowed. 2320 Revocation requests are different from other ACME requests in that 2321 they can be signed either with an account key pair or the key pair in 2322 the certificate. 2324 Example using an account key pair for the signature: 2326 POST /acme/revoke-cert HTTP/1.1 2327 Host: example.com 2328 Content-Type: application/jose+json 2330 { 2331 "protected": base64url({ 2332 "alg": "ES256", 2333 "kid": "https://example.com/acme/acct/1", 2334 "nonce": "JHb54aT_KTXBWQOzGYkt9A", 2335 "url": "https://example.com/acme/revoke-cert" 2336 }), 2337 "payload": base64url({ 2338 "certificate": "MIIEDTCCAvegAwIBAgIRAP8...", 2339 "reason": 4 2340 }), 2341 "signature": "Q1bURgJoEslbD1c5...3pYdSMLio57mQNN4" 2342 } 2344 Example using the certificate key pair for the signature: 2346 POST /acme/revoke-cert HTTP/1.1 2347 Host: example.com 2348 Content-Type: application/jose+json 2350 { 2351 "protected": base64url({ 2352 "alg": "RS256", 2353 "jwk": /* certificate's public key */, 2354 "nonce": "JHb54aT_KTXBWQOzGYkt9A", 2355 "url": "https://example.com/acme/revoke-cert" 2356 }), 2357 "payload": base64url({ 2358 "certificate": "MIIEDTCCAvegAwIBAgIRAP8...", 2359 "reason": 1 2360 }), 2361 "signature": "Q1bURgJoEslbD1c5...3pYdSMLio57mQNN4" 2362 } 2364 Before revoking a certificate, the server MUST verify that the key 2365 used to sign the request is authorized to revoke the certificate. 2366 The server MUST consider at least the following accounts authorized 2367 for a given certificate: 2369 o the account that issued the certificate. 2371 o an account that holds authorizations for all of the identifiers in 2372 the certificate. 2374 The server MUST also consider a revocation request valid if it is 2375 signed with the private key corresponding to the public key in the 2376 certificate. 2378 If the revocation succeeds, the server responds with status code 200 2379 (OK). If the revocation fails, the server returns an error. 2381 HTTP/1.1 200 OK 2382 Replay-Nonce: IXVHDyxIRGcTE0VSblhPzw 2383 Content-Length: 0 2385 --- or --- 2387 HTTP/1.1 403 Forbidden 2388 Replay-Nonce: IXVHDyxIRGcTE0VSblhPzw 2389 Content-Type: application/problem+json 2390 Content-Language: en 2392 { 2393 "type": "urn:ietf:params:acme:error:unauthorized", 2394 "detail": "No authorization provided for name example.net" 2395 } 2397 8. Identifier Validation Challenges 2399 There are few types of identifiers in the world for which there is a 2400 standardized mechanism to prove possession of a given identifier. In 2401 all practical cases, CAs rely on a variety of means to test whether 2402 an entity applying for a certificate with a given identifier actually 2403 controls that identifier. 2405 Challenges provide the server with assurance that an account holder 2406 is also the entity that controls an identifier. For each type of 2407 challenge, it must be the case that in order for an entity to 2408 successfully complete the challenge the entity must both: 2410 o Hold the private key of the account key pair used to respond to 2411 the challenge 2413 o Control the identifier in question 2414 Section 10 documents how the challenges defined in this document meet 2415 these requirements. New challenges will need to document how they 2416 do. 2418 ACME uses an extensible challenge/response framework for identifier 2419 validation. The server presents a set of challenges in the 2420 authorization object it sends to a client (as objects in the 2421 "challenges" array), and the client responds by sending a response 2422 object in a POST request to a challenge URL. 2424 This section describes an initial set of challenge types. The 2425 definition of a challenge type includes: 2427 1. Content of challenge objects 2429 2. Content of response objects 2431 3. How the server uses the challenge and response to verify control 2432 of an identifier 2434 Challenge objects all contain the following basic fields: 2436 type (required, string): The type of challenge encoded in the 2437 object. 2439 url (required, string): The URL to which a response can be posted. 2441 status (required, string): The status of this challenge. Possible 2442 values are: "pending", "processing", "valid", and "invalid". 2444 validated (optional, string): The time at which the server validated 2445 this challenge, encoded in the format specified in RFC 3339 2446 [RFC3339]. This field is REQUIRED if the "status" field is 2447 "valid". 2449 error (optional, object): Error that occurred while the server was 2450 validating the challenge, if any, structured as a problem document 2451 [RFC7807]. Multiple errors can be indicated by using subproblems 2452 Section 6.6.1. 2454 All additional fields are specified by the challenge type. If the 2455 server sets a challenge's "status" to "invalid", it SHOULD also 2456 include the "error" field to help the client diagnose why the 2457 challenge failed. 2459 Different challenges allow the server to obtain proof of different 2460 aspects of control over an identifier. In some challenges, like HTTP 2461 and DNS, the client directly proves its ability to do certain things 2462 related to the identifier. The choice of which challenges to offer 2463 to a client under which circumstances is a matter of server policy. 2465 The identifier validation challenges described in this section all 2466 relate to validation of domain names. If ACME is extended in the 2467 future to support other types of identifiers, there will need to be 2468 new challenge types, and they will need to specify which types of 2469 identifier they apply to. 2471 8.1. Key Authorizations 2473 All challenges defined in this document make use of a key 2474 authorization string. A key authorization is a string that expresses 2475 a domain holder's authorization for a specified key to satisfy a 2476 specified challenge, by concatenating the token for the challenge 2477 with a key fingerprint, separated by a "." character: 2479 keyAuthorization = token || '.' || base64url(JWK_Thumbprint(accountKey)) 2481 The "JWK_Thumbprint" step indicates the computation specified in 2482 [RFC7638], using the SHA-256 digest [FIPS180-4]. As noted in 2483 [RFC7518] any prepended zero octets in the fields of a JWK object 2484 MUST be stripped before doing the computation. 2486 As specified in the individual challenges below, the token for a 2487 challenge is a string comprised entirely of characters in the URL- 2488 safe base64 alphabet. The "||" operator indicates concatenation of 2489 strings. 2491 8.2. Retrying Challenges 2493 ACME challenges typically require the client to set up some network- 2494 accessible resource that the server can query in order to validate 2495 that the client controls an identifier. In practice it is not 2496 uncommon for the server's queries to fail while a resource is being 2497 set up, e.g., due to information propagating across a cluster or 2498 firewall rules not being in place. 2500 Clients SHOULD NOT respond to challenges until they believe that the 2501 server's queries will succeed. If a server's initial validation 2502 query fails, the server SHOULD retry the query after some time, in 2503 order to account for delay in setting up responses such as DNS 2504 records or HTTP resources. The precise retry schedule is up to the 2505 server, but server operators should keep in mind the operational 2506 scenarios that the schedule is trying to accommodate. Given that 2507 retries are intended to address things like propagation delays in 2508 HTTP or DNS provisioning, there should not usually be any reason to 2509 retry more often than every 5 or 10 seconds. While the server is 2510 still trying, the status of the challenge remains "processing"; it is 2511 only marked "invalid" once the server has given up. 2513 The server MUST provide information about its retry state to the 2514 client via the "error" field in the challenge and the Retry-After 2515 HTTP header field in response to requests to the challenge resource. 2516 The server MUST add an entry to the "error" field in the challenge 2517 after each failed validation query. The server SHOULD set the Retry- 2518 After header field to a time after the server's next validation 2519 query, since the status of the challenge will not change until that 2520 time. 2522 Clients can explicitly request a retry by re-sending their response 2523 to a challenge in a new POST request (with a new nonce, etc.). This 2524 allows clients to request a retry when the state has changed (e.g., 2525 after firewall rules have been updated). Servers SHOULD retry a 2526 request immediately on receiving such a POST request. In order to 2527 avoid denial-of-service attacks via client-initiated retries, servers 2528 SHOULD rate-limit such requests. 2530 8.3. HTTP Challenge 2532 With HTTP validation, the client in an ACME transaction proves its 2533 control over a domain name by proving that it can provision HTTP 2534 resources on a server accessible under that domain name. The ACME 2535 server challenges the client to provision a file at a specific path, 2536 with a specific string as its content. 2538 As a domain may resolve to multiple IPv4 and IPv6 addresses, the 2539 server will connect to at least one of the hosts found in the DNS A 2540 and AAAA records, at its discretion. Because many web servers 2541 allocate a default HTTPS virtual host to a particular low-privilege 2542 tenant user in a subtle and non-intuitive manner, the challenge must 2543 be completed over HTTP, not HTTPS. 2545 type (required, string): The string "http-01" 2547 token (required, string): A random value that uniquely identifies 2548 the challenge. This value MUST have at least 128 bits of entropy. 2549 It MUST NOT contain any characters outside the base64url alphabet, 2550 and MUST NOT include base64 padding characters ("="). 2552 GET /acme/authz/1234/0 HTTP/1.1 2553 Host: example.com 2555 HTTP/1.1 200 OK 2556 Content-Type: application/json 2558 { 2559 "type": "http-01", 2560 "url": "https://example.com/acme/authz/0", 2561 "status": "pending", 2562 "token": "LoqXcYV8q5ONbJQxbmR7SCTNo3tiAXDfowyjxAjEuX0" 2563 } 2565 A client fulfills this challenge by constructing a key authorization 2566 from the "token" value provided in the challenge and the client's 2567 account key. The client then provisions the key authorization as a 2568 resource on the HTTP server for the domain in question. 2570 The path at which the resource is provisioned is comprised of the 2571 fixed prefix "/.well-known/acme-challenge/", followed by the "token" 2572 value in the challenge. The value of the resource MUST be the ASCII 2573 representation of the key authorization. 2575 GET /.well-known/acme-challenge/LoqXcYV8q5ONbJQxbmR7SCTNo3tiAXDfowyjxAjEuX0 2576 Host: example.org 2578 HTTP/1.1 200 OK 2579 Content-Type: application/octet-stream 2581 LoqXcYV8q5ONbJQxbmR7SCTNo3tiAXDfowyjxAjEuX0.9jg46WB3rR_AHD-EBXdN7cBkH1WOu0tA3M9fm21mqTI 2583 A client responds with an empty object ({}) to acknowledge that the 2584 challenge can be validated by the server. 2586 POST /acme/authz/1234/0 2587 Host: example.com 2588 Content-Type: application/jose+json 2590 { 2591 "protected": base64url({ 2592 "alg": "ES256", 2593 "kid": "https://example.com/acme/acct/1", 2594 "nonce": "JHb54aT_KTXBWQOzGYkt9A", 2595 "url": "https://example.com/acme/authz/1234/0" 2596 }), 2597 "payload": base64url({}), 2598 "signature": "Q1bURgJoEslbD1c5...3pYdSMLio57mQNN4" 2599 } 2600 On receiving a response, the server constructs and stores the key 2601 authorization from the challenge "token" value and the current client 2602 account key. 2604 Given a challenge/response pair, the server verifies the client's 2605 control of the domain by verifying that the resource was provisioned 2606 as expected. 2608 1. Construct a URL by populating the URL template [RFC6570] 2609 "http://{domain}/.well-known/acme-challenge/{token}", where: 2611 * the domain field is set to the domain name being verified; and 2613 * the token field is set to the token in the challenge. 2615 2. Verify that the resulting URL is well-formed. 2617 3. Dereference the URL using an HTTP GET request. This request MUST 2618 be sent to TCP port 80 on the HTTP server. 2620 4. Verify that the body of the response is well-formed key 2621 authorization. The server SHOULD ignore whitespace characters at 2622 the end of the body. 2624 5. Verify that key authorization provided by the HTTP server matches 2625 the key authorization stored by the server. 2627 The server SHOULD follow redirects when dereferencing the URL. 2629 If all of the above verifications succeed, then the validation is 2630 successful. If the request fails, or the body does not pass these 2631 checks, then it has failed. 2633 8.4. DNS Challenge 2635 When the identifier being validated is a domain name, the client can 2636 prove control of that domain by provisioning a TXT resource record 2637 containing a designated value for a specific validation domain name. 2639 type (required, string): The string "dns-01" 2641 token (required, string): A random value that uniquely identifies 2642 the challenge. This value MUST have at least 128 bits of entropy. 2643 It MUST NOT contain any characters outside the base64url alphabet, 2644 including padding characters ("="). 2646 GET /acme/authz/1234/2 HTTP/1.1 2647 Host: example.com 2649 HTTP/1.1 200 OK 2650 Content-Type: application/json 2652 { 2653 "type": "dns-01", 2654 "url": "https://example.com/acme/authz/1234/2", 2655 "status": "pending", 2656 "token": "evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA" 2657 } 2659 A client fulfills this challenge by constructing a key authorization 2660 from the "token" value provided in the challenge and the client's 2661 account key. The client then computes the SHA-256 digest [FIPS180-4] 2662 of the key authorization. 2664 The record provisioned to the DNS contains the base64url encoding of 2665 this digest. The client constructs the validation domain name by 2666 prepending the label "_acme-challenge" to the domain name being 2667 validated, then provisions a TXT record with the digest value under 2668 that name. For example, if the domain name being validated is 2669 "example.org", then the client would provision the following DNS 2670 record: 2672 _acme-challenge.example.org. 300 IN TXT "gfj9Xq...Rg85nM" 2674 A client responds with an empty object ({}) to acknowledge that the 2675 challenge can be validated by the server. 2677 POST /acme/authz/1234/2 2678 Host: example.com 2679 Content-Type: application/jose+json 2681 { 2682 "protected": base64url({ 2683 "alg": "ES256", 2684 "kid": "https://example.com/acme/acct/1", 2685 "nonce": "JHb54aT_KTXBWQOzGYkt9A", 2686 "url": "https://example.com/acme/authz/1234/2" 2687 }), 2688 "payload": base64url({}), 2689 "signature": "Q1bURgJoEslbD1c5...3pYdSMLio57mQNN4" 2690 } 2691 On receiving a response, the server constructs and stores the key 2692 authorization from the challenge "token" value and the current client 2693 account key. 2695 To validate a DNS challenge, the server performs the following steps: 2697 1. Compute the SHA-256 digest [FIPS180-4] of the stored key 2698 authorization 2700 2. Query for TXT records for the validation domain name 2702 3. Verify that the contents of one of the TXT records match the 2703 digest value 2705 If all of the above verifications succeed, then the validation is 2706 successful. If no DNS record is found, or DNS record and response 2707 payload do not pass these checks, then the validation fails. 2709 9. IANA Considerations 2711 9.1. MIME Type: application/pem-certificate-chain 2713 The "Media Types" registry should be updated with the following 2714 additional value: 2716 MIME media type name: application 2718 MIME subtype name: pem-certificate-chain 2720 Required parameters: None 2722 Optional parameters: None 2724 Encoding considerations: None 2726 Security considerations: Carries a cryptographic certificate and its 2727 associated certificate chain 2729 Interoperability considerations: None 2731 Published specification: draft-ietf-acme-acme [[ RFC EDITOR: Please 2732 replace draft-ietf-acme-acme above with the RFC number assigned to 2733 this ]] 2735 Applications which use this media type: Any MIME-compliant transport 2737 Additional information: 2739 File contains one or more certificates encoded with the PEM textual 2740 encoding, according to RFC 7468 [RFC7468]. In order to provide easy 2741 interoperation with TLS, the first certificate MUST be an end-entity 2742 certificate. Each following certificate SHOULD directly certify one 2743 preceding it. Because certificate validation requires that trust 2744 anchors be distributed independently, a certificate that specifies a 2745 trust anchor MAY be omitted from the chain, provided that supported 2746 peers are known to possess any omitted certificates. 2748 9.2. Well-Known URI for the HTTP Challenge 2750 The "Well-Known URIs" registry should be updated with the following 2751 additional value (using the template from [RFC5785]): 2753 URI suffix: acme-challenge 2755 Change controller: IETF 2757 Specification document(s): This document, Section Section 8.3 2759 Related information: N/A 2761 9.3. Replay-Nonce HTTP Header 2763 The "Message Headers" registry should be updated with the following 2764 additional value: 2766 +-------------------+----------+----------+---------------+ 2767 | Header Field Name | Protocol | Status | Reference | 2768 +-------------------+----------+----------+---------------+ 2769 | Replay-Nonce | http | standard | Section 6.4.1 | 2770 +-------------------+----------+----------+---------------+ 2772 9.4. "url" JWS Header Parameter 2774 The "JSON Web Signature and Encryption Header Parameters" registry 2775 should be updated with the following additional value: 2777 o Header Parameter Name: "url" 2779 o Header Parameter Description: URL 2781 o Header Parameter Usage Location(s): JWE, JWS 2783 o Change Controller: IESG 2785 o Specification Document(s): Section 6.3.1 of RFC XXXX 2787 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2788 to this document ]] 2790 9.5. "nonce" JWS Header Parameter 2792 The "JSON Web Signature and Encryption Header Parameters" registry 2793 should be updated with the following additional value: 2795 o Header Parameter Name: "nonce" 2797 o Header Parameter Description: Nonce 2799 o Header Parameter Usage Location(s): JWE, JWS 2801 o Change Controller: IESG 2803 o Specification Document(s): Section 6.4.2 of RFC XXXX 2805 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2806 to this document ]] 2808 9.6. URN Sub-namespace for ACME (urn:ietf:params:acme) 2810 The "IETF URN Sub-namespace for Registered Protocol Parameter 2811 Identifiers" registry should be updated with the following additional 2812 value, following the template in [RFC3553]: 2814 Registry name: acme 2816 Specification: RFC XXXX 2818 Repository: URL-TBD 2820 Index value: No transformation needed. 2822 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2823 to this document, and replace URL-TBD with the URL assigned by IANA 2824 for registries of ACME parameters. ]] 2826 9.7. New Registries 2828 This document requests that IANA create the following new registries: 2830 1. ACME Account Object Fields (Section 9.7.1) 2832 2. ACME Order Object Fields (Section 9.7.2) 2834 3. ACME Error Types (Section 9.7.4) 2835 4. ACME Resource Types (Section 9.7.5) 2837 5. ACME Directory Metadata Fields (Section 9.7.6) 2839 6. ACME Identifier Types (Section 9.7.7) 2841 7. ACME Validation Methods (Section 9.7.8) 2843 All of these registries are under a heading of "Automated Certificate 2844 Management Environment (ACME) Protocol" and are administered under a 2845 Specification Required policy [RFC8126]. 2847 9.7.1. Fields in Account Objects 2849 This registry lists field names that are defined for use in ACME 2850 account objects. Fields marked as "configurable" may be included in 2851 a new-account request. 2853 Template: 2855 o Field name: The string to be used as a field name in the JSON 2856 object 2858 o Field type: The type of value to be provided, e.g., string, 2859 boolean, array of string 2861 o Client configurable: Boolean indicating whether the server should 2862 accept values provided by the client 2864 o Reference: Where this field is defined 2866 Initial contents: The fields and descriptions defined in 2867 Section 7.1.2. 2869 +------------------------+---------------+--------------+-----------+ 2870 | Field Name | Field Type | Configurable | Reference | 2871 +------------------------+---------------+--------------+-----------+ 2872 | status | string | false | RFC XXXX | 2873 | | | | | 2874 | contact | array of | true | RFC XXXX | 2875 | | string | | | 2876 | | | | | 2877 | externalAccountBinding | object | true | RFC XXXX | 2878 | | | | | 2879 | termsOfServiceAgreed | boolean | true | RFC XXXX | 2880 | | | | | 2881 | orders | string | false | RFC XXXX | 2882 +------------------------+---------------+--------------+-----------+ 2884 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2885 to this document ]] 2887 9.7.2. Fields in Order Objects 2889 This registry lists field names that are defined for use in ACME 2890 order objects. Fields marked as "configurable" may be included in a 2891 new-order request. 2893 Template: 2895 o Field name: The string to be used as a field name in the JSON 2896 object 2898 o Field type: The type of value to be provided, e.g., string, 2899 boolean, array of string 2901 o Client configurable: Boolean indicating whether the server should 2902 accept values provided by the client 2904 o Reference: Where this field is defined 2906 Initial contents: The fields and descriptions defined in 2907 Section 7.1.3. 2909 +----------------+-----------------+--------------+-----------+ 2910 | Field Name | Field Type | Configurable | Reference | 2911 +----------------+-----------------+--------------+-----------+ 2912 | status | string | false | RFC XXXX | 2913 | | | | | 2914 | expires | string | false | RFC XXXX | 2915 | | | | | 2916 | identifiers | array of object | true | RFC XXXX | 2917 | | | | | 2918 | notBefore | string | true | RFC XXXX | 2919 | | | | | 2920 | notAfter | string | true | RFC XXXX | 2921 | | | | | 2922 | authorizations | array of string | false | RFC XXXX | 2923 | | | | | 2924 | finalize | string | false | RFC XXXX | 2925 | | | | | 2926 | certificate | string | false | RFC XXXX | 2927 +----------------+-----------------+--------------+-----------+ 2929 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2930 to this document ]] 2932 9.7.3. Fields in Authorization Objects 2934 This registry lists field names that are defined for use in ACME 2935 authorization objects. Fields marked as "configurable" may be 2936 included in a new-authorization request. 2938 Template: 2940 o Field name: The string to be used as a field name in the JSON 2941 object 2943 o Field type: The type of value to be provided, e.g., string, 2944 boolean, array of string 2946 o Client configurable: Boolean indicating whether the server should 2947 accept values provided by the client 2949 o Reference: Where this field is defined 2951 Initial contents: The fields and descriptions defined in 2952 Section 7.1.4. 2954 +------------+-----------------+--------------+-----------+ 2955 | Field Name | Field Type | Configurable | Reference | 2956 +------------+-----------------+--------------+-----------+ 2957 | identifier | object | true | RFC XXXX | 2958 | | | | | 2959 | status | string | false | RFC XXXX | 2960 | | | | | 2961 | expires | string | false | RFC XXXX | 2962 | | | | | 2963 | challenges | array of object | false | RFC XXXX | 2964 | | | | | 2965 | wildcard | boolean | false | RFC XXXX | 2966 +------------+-----------------+--------------+-----------+ 2968 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2969 to this document ]] 2971 9.7.4. Error Types 2973 This registry lists values that are used within URN values that are 2974 provided in the "type" field of problem documents in ACME. 2976 Template: 2978 o Type: The label to be included in the URN for this error, 2979 following "urn:ietf:params:acme:error:" 2981 o Description: A human-readable description of the error 2983 o Reference: Where the error is defined 2985 Initial contents: The types and descriptions in the table in 2986 Section 6.6 above, with the Reference field set to point to this 2987 specification. 2989 9.7.5. Resource Types 2991 This registry lists the types of resources that ACME servers may list 2992 in their directory objects. 2994 Template: 2996 o Field name: The value to be used as a field name in the directory 2997 object 2999 o Resource type: The type of resource labeled by the field 3001 o Reference: Where the resource type is defined 3003 Initial contents: 3005 +------------+--------------------+-----------+ 3006 | Field Name | Resource Type | Reference | 3007 +------------+--------------------+-----------+ 3008 | newNonce | New nonce | RFC XXXX | 3009 | | | | 3010 | newAccount | New account | RFC XXXX | 3011 | | | | 3012 | newOrder | New order | RFC XXXX | 3013 | | | | 3014 | newAuthz | New authorization | RFC XXXX | 3015 | | | | 3016 | revokeCert | Revoke certificate | RFC XXXX | 3017 | | | | 3018 | keyChange | Key change | RFC XXXX | 3019 | | | | 3020 | meta | Metadata object | RFC XXXX | 3021 +------------+--------------------+-----------+ 3023 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 3024 to this document ]] 3026 9.7.6. Fields in the "meta" Object within a Directory Object 3028 This registry lists field names that are defined for use in the JSON 3029 object included in the "meta" field of an ACME directory object. 3031 Template: 3033 o Field name: The string to be used as a field name in the JSON 3034 object 3036 o Field type: The type of value to be provided, e.g., string, 3037 boolean, array of string 3039 o Reference: Where this field is defined 3041 Initial contents: The fields and descriptions defined in 3042 Section 7.1.2. 3044 +-------------------------+-----------------+-----------+ 3045 | Field Name | Field Type | Reference | 3046 +-------------------------+-----------------+-----------+ 3047 | termsOfService | string | RFC XXXX | 3048 | | | | 3049 | website | string | RFC XXXX | 3050 | | | | 3051 | caaIdentities | array of string | RFC XXXX | 3052 | | | | 3053 | externalAccountRequired | boolean | RFC XXXX | 3054 +-------------------------+-----------------+-----------+ 3056 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 3057 to this document ]] 3059 9.7.7. Identifier Types 3061 This registry lists the types of identifiers that can be present in 3062 ACME authorization objects. 3064 Template: 3066 o Label: The value to be put in the "type" field of the identifier 3067 object 3069 o Reference: Where the identifier type is defined 3071 Initial contents: 3073 +-------+-----------+ 3074 | Label | Reference | 3075 +-------+-----------+ 3076 | dns | RFC XXXX | 3077 +-------+-----------+ 3079 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 3080 to this document ]] 3082 9.7.8. Validation Methods 3084 This registry lists identifiers for the ways that CAs can validate 3085 control of identifiers. Each method's entry must specify whether it 3086 corresponds to an ACME challenge type. The "Identifier Type" field 3087 must be contained in the Label column of the ACME Identifier Types 3088 registry. 3090 Template: 3092 o Label: The identifier for this validation method 3094 o Identifier Type: The type of identifier that this method applies 3095 to 3097 o ACME: "Y" if the validation method corresponds to an ACME 3098 challenge type; "N" otherwise. 3100 o Reference: Where the validation method is defined 3102 Initial Contents 3104 +------------+-----------------+------+-----------+ 3105 | Label | Identifier Type | ACME | Reference | 3106 +------------+-----------------+------+-----------+ 3107 | http-01 | dns | Y | RFC XXXX | 3108 | | | | | 3109 | dns-01 | dns | Y | RFC XXXX | 3110 | | | | | 3111 | tls-sni-01 | RESERVED | N | N/A | 3112 | | | | | 3113 | tls-sni-02 | RESERVED | N | N/A | 3114 +------------+-----------------+------+-----------+ 3116 When evaluating a request for an assignment in this registry, the 3117 designated expert should ensure that the method being registered has 3118 a clear, interoperable definition and does not overlap with existing 3119 validation methods. That is, it should not be possible for a client 3120 and server to follow the same set of actions to fulfill two different 3121 validation methods. 3123 Validation methods do not have to be compatible with ACME in order to 3124 be registered. For example, a CA might wish to register a validation 3125 method in order to support its use with the ACME extensions to CAA 3126 [I-D.ietf-acme-caa]. 3128 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 3129 to this document ]] 3131 10. Security Considerations 3133 ACME is a protocol for managing certificates that attest to 3134 identifier/key bindings. Thus the foremost security goal of ACME is 3135 to ensure the integrity of this process, i.e., to ensure that the 3136 bindings attested by certificates are correct and that only 3137 authorized entities can manage certificates. ACME identifies clients 3138 by their account keys, so this overall goal breaks down into two more 3139 precise goals: 3141 1. Only an entity that controls an identifier can get an 3142 authorization for that identifier 3144 2. Once authorized, an account key's authorizations cannot be 3145 improperly used by another account 3147 In this section, we discuss the threat model that underlies ACME and 3148 the ways that ACME achieves these security goals within that threat 3149 model. We also discuss the denial-of-service risks that ACME servers 3150 face, and a few other miscellaneous considerations. 3152 10.1. Threat Model 3154 As a service on the Internet, ACME broadly exists within the Internet 3155 threat model [RFC3552]. In analyzing ACME, it is useful to think of 3156 an ACME server interacting with other Internet hosts along two 3157 "channels": 3159 o An ACME channel, over which the ACME HTTPS requests are exchanged 3161 o A validation channel, over which the ACME server performs 3162 additional requests to validate a client's control of an 3163 identifier 3165 +------------+ 3166 | ACME | ACME Channel 3167 | Client |--------------------+ 3168 +------------+ | 3169 V 3170 +------------+ 3171 | ACME | 3172 | Server | 3173 +------------+ 3174 +------------+ | 3175 | Validation |<-------------------+ 3176 | Server | Validation Channel 3177 +------------+ 3179 In practice, the risks to these channels are not entirely separate, 3180 but they are different in most cases. Each channel, for example, 3181 uses a different communications pattern: the ACME channel will 3182 comprise inbound HTTPS connections to the ACME server and the 3183 validation channel outbound HTTP or DNS requests. 3185 Broadly speaking, ACME aims to be secure against active and passive 3186 attackers on any individual channel. Some vulnerabilities arise 3187 (noted below) when an attacker can exploit both the ACME channel and 3188 one of the others. 3190 On the ACME channel, in addition to network layer attackers, we also 3191 need to account for man-in-the-middle (MitM) attacks at the 3192 application layer, and for abusive use of the protocol itself. 3193 Protection against application layer MitM addresses potential 3194 attackers such as Content Distribution Networks (CDNs) and 3195 middleboxes with a TLS MitM function. Preventing abusive use of ACME 3196 means ensuring that an attacker with access to the validation channel 3197 can't obtain illegitimate authorization by acting as an ACME client 3198 (legitimately, in terms of the protocol). 3200 10.2. Integrity of Authorizations 3202 ACME allows anyone to request challenges for an identifier by 3203 registering an account key and sending a new-order request using that 3204 account key. The integrity of the authorization process thus depends 3205 on the identifier validation challenges to ensure that the challenge 3206 can only be completed by someone who both (1) holds the private key 3207 of the account key pair, and (2) controls the identifier in question. 3209 Validation responses need to be bound to an account key pair in order 3210 to avoid situations where an ACME MitM can switch out a legitimate 3211 domain holder's account key for one of his choosing, e.g.: 3213 o Legitimate domain holder registers account key pair A 3215 o MitM registers account key pair B 3217 o Legitimate domain holder sends a new-order request signed using 3218 account key A 3220 o MitM suppresses the legitimate request but sends the same request 3221 signed using account key B 3223 o ACME server issues challenges and MitM forwards them to the 3224 legitimate domain holder 3226 o Legitimate domain holder provisions the validation response 3228 o ACME server performs validation query and sees the response 3229 provisioned by the legitimate domain holder 3231 o Because the challenges were issued in response to a message signed 3232 account key B, the ACME server grants authorization to account key 3233 B (the MitM) instead of account key A (the legitimate domain 3234 holder) 3236 All of the challenges above have a binding between the account 3237 private key and the validation query made by the server, via the key 3238 authorization. The key authorization reflects the account public 3239 key, is provided to the server in the validation response over the 3240 validation channel and signed afterwards by the corresponding private 3241 key in the challenge response over the ACME channel. 3243 The association of challenges to identifiers is typically done by 3244 requiring the client to perform some action that only someone who 3245 effectively controls the identifier can perform. For the challenges 3246 in this document, the actions are: 3248 o HTTP: Provision files under .well-known on a web server for the 3249 domain 3251 o DNS: Provision DNS resource records for the domain 3253 There are several ways that these assumptions can be violated, both 3254 by misconfiguration and by attacks. For example, on a web server 3255 that allows non-administrative users to write to .well-known, any 3256 user can claim to own the web server's hostname by responding to an 3257 HTTP challenge. Similarly, if a server that can be used for ACME 3258 validation is compromised by a malicious actor, then that malicious 3259 actor can use that access to obtain certificates via ACME. 3261 The use of hosting providers is a particular risk for ACME 3262 validation. If the owner of the domain has outsourced operation of 3263 DNS or web services to a hosting provider, there is nothing that can 3264 be done against tampering by the hosting provider. As far as the 3265 outside world is concerned, the zone or website provided by the 3266 hosting provider is the real thing. 3268 More limited forms of delegation can also lead to an unintended party 3269 gaining the ability to successfully complete a validation 3270 transaction. For example, suppose an ACME server follows HTTP 3271 redirects in HTTP validation and a website operator provisions a 3272 catch-all redirect rule that redirects requests for unknown resources 3273 to a different domain. Then the target of the redirect could use 3274 that to get a certificate through HTTP validation since the 3275 validation path will not be known to the primary server. 3277 The DNS is a common point of vulnerability for all of these 3278 challenges. An entity that can provision false DNS records for a 3279 domain can attack the DNS challenge directly and can provision false 3280 A/AAAA records to direct the ACME server to send its HTTP validation 3281 query to a remote server of the attacker's choosing. There are a few 3282 different mitigations that ACME servers can apply: 3284 o Always querying the DNS using a DNSSEC-validating resolver 3285 (enhancing security for zones that are DNSSEC-enabled) 3287 o Querying the DNS from multiple vantage points to address local 3288 attackers 3290 o Applying mitigations against DNS off-path attackers, e.g., adding 3291 entropy to requests [I-D.vixie-dnsext-dns0x20] or only using TCP 3293 Given these considerations, the ACME validation process makes it 3294 impossible for any attacker on the ACME channel or a passive attacker 3295 on the validation channel to hijack the authorization process to 3296 authorize a key of the attacker's choice. 3298 An attacker that can only see the ACME channel would need to convince 3299 the validation server to provide a response that would authorize the 3300 attacker's account key, but this is prevented by binding the 3301 validation response to the account key used to request challenges. A 3302 passive attacker on the validation channel can observe the correct 3303 validation response and even replay it, but that response can only be 3304 used with the account key for which it was generated. 3306 An active attacker on the validation channel can subvert the ACME 3307 process, by performing normal ACME transactions and providing a 3308 validation response for his own account key. The risks due to 3309 hosting providers noted above are a particular case. 3311 It is RECOMMENDED that the server perform DNS queries and make HTTP 3312 connections from various network perspectives, in order to make MitM 3313 attacks harder. 3315 10.3. Denial-of-Service Considerations 3317 As a protocol run over HTTPS, standard considerations for TCP-based 3318 and HTTP-based DoS mitigation also apply to ACME. 3320 At the application layer, ACME requires the server to perform a few 3321 potentially expensive operations. Identifier validation transactions 3322 require the ACME server to make outbound connections to potentially 3323 attacker-controlled servers, and certificate issuance can require 3324 interactions with cryptographic hardware. 3326 In addition, an attacker can also cause the ACME server to send 3327 validation requests to a domain of its choosing by submitting 3328 authorization requests for the victim domain. 3330 All of these attacks can be mitigated by the application of 3331 appropriate rate limits. Issues closer to the front end, like POST 3332 body validation, can be addressed using HTTP request limiting. For 3333 validation and certificate requests, there are other identifiers on 3334 which rate limits can be keyed. For example, the server might limit 3335 the rate at which any individual account key can issue certificates 3336 or the rate at which validation can be requested within a given 3337 subtree of the DNS. And in order to prevent attackers from 3338 circumventing these limits simply by minting new accounts, servers 3339 would need to limit the rate at which accounts can be registered. 3341 10.4. Server-Side Request Forgery 3343 Server-Side Request Forgery (SSRF) attacks can arise when an attacker 3344 can cause a server to perform HTTP requests to an attacker-chosen 3345 URL. In the ACME HTTP challenge validation process, the ACME server 3346 performs an HTTP GET request to a URL in which the attacker can 3347 choose the domain. This request is made before the server has 3348 verified that the client controls the domain, so any client can cause 3349 a query to any domain. 3351 Some server implementations include information from the validation 3352 server's response (in order to facilitate debugging). Such 3353 implementations enable an attacker to extract this information from 3354 any web server that is accessible to the ACME server, even if it is 3355 not accessible to the ACME client. 3357 It might seem that the risk of SSRF through this channel is limited 3358 by the fact that the attacker can only control the domain of the URL, 3359 not the path. However, if the attacker first sets the domain to one 3360 they control, then they can send the server an HTTP redirect (e.g., a 3361 302 response) which will cause the server to query an arbitrary URL. 3363 In order to further limit the SSRF risk, ACME server operators should 3364 ensure that validation queries can only be sent to servers on the 3365 public Internet, and not, say, web services within the server 3366 operator's internal network. Since the attacker could make requests 3367 to these public servers himself, he can't gain anything extra through 3368 an SSRF attack on ACME aside from a layer of anonymization. 3370 10.5. CA Policy Considerations 3372 The controls on issuance enabled by ACME are focused on validating 3373 that a certificate applicant controls the identifier he claims. 3374 Before issuing a certificate, however, there are many other checks 3375 that a CA might need to perform, for example: 3377 o Has the client agreed to a subscriber agreement? 3379 o Is the claimed identifier syntactically valid? 3381 o For domain names: 3383 * If the leftmost label is a '*', then have the appropriate 3384 checks been applied? 3386 * Is the name on the Public Suffix List? 3388 * Is the name a high-value name? 3390 * Is the name a known phishing domain? 3392 o Is the key in the CSR sufficiently strong? 3394 o Is the CSR signed with an acceptable algorithm? 3396 o Has issuance been authorized or forbidden by a Certificate 3397 Authority Authorization (CAA) record? [RFC6844] 3399 CAs that use ACME to automate issuance will need to ensure that their 3400 servers perform all necessary checks before issuing. 3402 CAs using ACME to allow clients to agree to terms of service should 3403 keep in mind that ACME clients can automate this agreement, possibly 3404 not involving a human user. 3406 11. Operational Considerations 3408 There are certain factors that arise in operational reality that 3409 operators of ACME-based CAs will need to keep in mind when 3410 configuring their services. For example: 3412 11.1. DNS security 3414 As noted above, DNS forgery attacks against the ACME server can 3415 result in the server making incorrect decisions about domain control 3416 and thus mis-issuing certificates. Servers SHOULD perform DNS 3417 queries over TCP, which provides better resistance to some forgery 3418 attacks than DNS over UDP. 3420 An ACME-based CA will often need to make DNS queries, e.g., to 3421 validate control of DNS names. Because the security of such 3422 validations ultimately depends on the authenticity of DNS data, every 3423 possible precaution should be taken to secure DNS queries done by the 3424 CA. It is therefore RECOMMENDED that ACME-based CAs make all DNS 3425 queries via DNSSEC-validating stub or recursive resolvers. This 3426 provides additional protection to domains which choose to make use of 3427 DNSSEC. 3429 An ACME-based CA must use only a resolver if it trusts the resolver 3430 and every component of the network route by which it is accessed. It 3431 is therefore RECOMMENDED that ACME-based CAs operate their own 3432 DNSSEC-validating resolvers within their trusted network and use 3433 these resolvers both for both CAA record lookups and all record 3434 lookups in furtherance of a challenge scheme (A, AAAA, TXT, etc.). 3436 11.2. Token Entropy 3438 The http-01, and dns-01 validation methods mandate the usage of a 3439 random token value to uniquely identify the challenge. The value of 3440 the token is required to contain at least 128 bits of entropy for the 3441 following security properties. First, the ACME client should not be 3442 able to influence the ACME server's choice of token as this may allow 3443 an attacker to reuse a domain owner's previous challenge responses 3444 for a new validation request. Secondly, the entropy requirement 3445 prevents ACME clients from implementing a "naive" validation server 3446 that automatically replies to challenges without participating in the 3447 creation of the initial authorization request. 3449 11.3. Malformed Certificate Chains 3451 ACME provides certificate chains in the widely-used format known 3452 colloquially as PEM (though it may diverge from the actual Privacy 3453 Enhanced Mail specifications [RFC1421], as noted in [RFC7468]). Some 3454 current software will allow the configuration of a private key and a 3455 certificate in one PEM file, by concatenating the textual encodings 3456 of the two objects. In the context of ACME, such software might be 3457 vulnerable to "key replacement" attacks. A malicious ACME server 3458 could cause a client to use a private key of its choosing by 3459 including the key in the PEM file returned in response to a query for 3460 a certificate URL. 3462 When processing an file of type "application/pem-certificate-chain", 3463 a client SHOULD verify that the file contains only encoded 3464 certificates. If anything other than a certificate is found (i.e., 3465 if the string "-----BEGIN" is ever followed by anything other than 3466 "CERTIFICATE"), then the client MUST reject the file as invalid. 3468 12. Acknowledgements 3470 In addition to the editors listed on the front page, this document 3471 has benefited from contributions from a broad set of contributors, 3472 all the way back to its inception. 3474 o Peter Eckersley, EFF 3476 o Eric Rescorla, Mozilla 3478 o Seth Schoen, EFF 3480 o Alex Halderman, University of Michigan 3482 o Martin Thomson, Mozilla 3484 o Jakub Warmuz, University of Oxford 3486 o Sophie Herold, Hemio 3488 This document draws on many concepts established by Eric Rescorla's 3489 "Automated Certificate Issuance Protocol" draft. Martin Thomson 3490 provided helpful guidance in the use of HTTP. 3492 13. References 3494 13.1. Normative References 3496 [FIPS180-4] 3497 Department of Commerce, National., "NIST FIPS 180-4, 3498 Secure Hash Standard", March 2012, 3499 . 3502 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 3503 Requirement Levels", BCP 14, RFC 2119, 3504 DOI 10.17487/RFC2119, March 1997, 3505 . 3507 [RFC2585] Housley, R. and P. Hoffman, "Internet X.509 Public Key 3508 Infrastructure Operational Protocols: FTP and HTTP", 3509 RFC 2585, DOI 10.17487/RFC2585, May 1999, 3510 . 3512 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, 3513 DOI 10.17487/RFC2818, May 2000, 3514 . 3516 [RFC2985] Nystrom, M. and B. Kaliski, "PKCS #9: Selected Object 3517 Classes and Attribute Types Version 2.0", RFC 2985, 3518 DOI 10.17487/RFC2985, November 2000, 3519 . 3521 [RFC2986] Nystrom, M. and B. Kaliski, "PKCS #10: Certification 3522 Request Syntax Specification Version 1.7", RFC 2986, 3523 DOI 10.17487/RFC2986, November 2000, 3524 . 3526 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 3527 Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002, 3528 . 3530 [RFC3492] Costello, A., "Punycode: A Bootstring encoding of Unicode 3531 for Internationalized Domain Names in Applications 3532 (IDNA)", RFC 3492, DOI 10.17487/RFC3492, March 2003, 3533 . 3535 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 3536 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November 3537 2003, . 3539 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 3540 Resource Identifier (URI): Generic Syntax", STD 66, 3541 RFC 3986, DOI 10.17487/RFC3986, January 2005, 3542 . 3544 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 3545 Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, 3546 . 3548 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 3549 (TLS) Protocol Version 1.2", RFC 5246, 3550 DOI 10.17487/RFC5246, August 2008, 3551 . 3553 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 3554 Housley, R., and W. Polk, "Internet X.509 Public Key 3555 Infrastructure Certificate and Certificate Revocation List 3556 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 3557 . 3559 [RFC5890] Klensin, J., "Internationalized Domain Names for 3560 Applications (IDNA): Definitions and Document Framework", 3561 RFC 5890, DOI 10.17487/RFC5890, August 2010, 3562 . 3564 [RFC5988] Nottingham, M., "Web Linking", RFC 5988, 3565 DOI 10.17487/RFC5988, October 2010, 3566 . 3568 [RFC6068] Duerst, M., Masinter, L., and J. Zawinski, "The 'mailto' 3569 URI Scheme", RFC 6068, DOI 10.17487/RFC6068, October 2010, 3570 . 3572 [RFC6570] Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., 3573 and D. Orchard, "URI Template", RFC 6570, 3574 DOI 10.17487/RFC6570, March 2012, 3575 . 3577 [RFC6844] Hallam-Baker, P. and R. Stradling, "DNS Certification 3578 Authority Authorization (CAA) Resource Record", RFC 6844, 3579 DOI 10.17487/RFC6844, January 2013, 3580 . 3582 [RFC7159] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 3583 Interchange Format", RFC 7159, DOI 10.17487/RFC7159, March 3584 2014, . 3586 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 3587 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 3588 DOI 10.17487/RFC7231, June 2014, 3589 . 3591 [RFC7468] Josefsson, S. and S. Leonard, "Textual Encodings of PKIX, 3592 PKCS, and CMS Structures", RFC 7468, DOI 10.17487/RFC7468, 3593 April 2015, . 3595 [RFC7515] Jones, M., Bradley, J., and N. Sakimura, "JSON Web 3596 Signature (JWS)", RFC 7515, DOI 10.17487/RFC7515, May 3597 2015, . 3599 [RFC7518] Jones, M., "JSON Web Algorithms (JWA)", RFC 7518, 3600 DOI 10.17487/RFC7518, May 2015, 3601 . 3603 [RFC7638] Jones, M. and N. Sakimura, "JSON Web Key (JWK) 3604 Thumbprint", RFC 7638, DOI 10.17487/RFC7638, September 3605 2015, . 3607 [RFC7797] Jones, M., "JSON Web Signature (JWS) Unencoded Payload 3608 Option", RFC 7797, DOI 10.17487/RFC7797, February 2016, 3609 . 3611 [RFC7807] Nottingham, M. and E. Wilde, "Problem Details for HTTP 3612 APIs", RFC 7807, DOI 10.17487/RFC7807, March 2016, 3613 . 3615 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 3616 Writing an IANA Considerations Section in RFCs", BCP 26, 3617 RFC 8126, DOI 10.17487/RFC8126, June 2017, 3618 . 3620 13.2. Informative References 3622 [I-D.ietf-acme-caa] 3623 Landau, H., "CAA Record Extensions for Account URI and 3624 ACME Method Binding", draft-ietf-acme-caa-03 (work in 3625 progress), August 2017. 3627 [I-D.ietf-acme-ip] 3628 Shoemaker, R., "ACME IP Identifier Validation Extension", 3629 draft-ietf-acme-ip-01 (work in progress), September 2017. 3631 [I-D.ietf-acme-telephone] 3632 Peterson, J. and R. Barnes, "ACME Identifiers and 3633 Challenges for Telephone Numbers", draft-ietf-acme- 3634 telephone-01 (work in progress), October 2017. 3636 [I-D.vixie-dnsext-dns0x20] 3637 Vixie, P. and D. Dagon, "Use of Bit 0x20 in DNS Labels to 3638 Improve Transaction Identity", draft-vixie-dnsext- 3639 dns0x20-00 (work in progress), March 2008. 3641 [RFC1421] Linn, J., "Privacy Enhancement for Internet Electronic 3642 Mail: Part I: Message Encryption and Authentication 3643 Procedures", RFC 1421, DOI 10.17487/RFC1421, February 3644 1993, . 3646 [RFC3552] Rescorla, E. and B. Korver, "Guidelines for Writing RFC 3647 Text on Security Considerations", BCP 72, RFC 3552, 3648 DOI 10.17487/RFC3552, July 2003, 3649 . 3651 [RFC3553] Mealling, M., Masinter, L., Hardie, T., and G. Klyne, "An 3652 IETF URN Sub-namespace for Registered Protocol 3653 Parameters", BCP 73, RFC 3553, DOI 10.17487/RFC3553, June 3654 2003, . 3656 [RFC5785] Nottingham, M. and E. Hammer-Lahav, "Defining Well-Known 3657 Uniform Resource Identifiers (URIs)", RFC 5785, 3658 DOI 10.17487/RFC5785, April 2010, 3659 . 3661 [RFC7525] Sheffer, Y., Holz, R., and P. Saint-Andre, 3662 "Recommendations for Secure Use of Transport Layer 3663 Security (TLS) and Datagram Transport Layer Security 3664 (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May 3665 2015, . 3667 [W3C.CR-cors-20130129] 3668 Kesteren, A., "Cross-Origin Resource Sharing", World Wide 3669 Web Consortium CR CR-cors-20130129, January 2013, 3670 . 3672 13.3. URIs 3674 [1] https://github.com/ietf-wg-acme/acme 3676 Authors' Addresses 3678 Richard Barnes 3679 Cisco 3681 Email: rlb@ipv.sx 3683 Jacob Hoffman-Andrews 3684 EFF 3686 Email: jsha@eff.org 3687 Daniel McCarney 3688 Let's Encrypt 3690 Email: cpu@letsencrypt.org 3692 James Kasten 3693 University of Michigan 3695 Email: jdkasten@umich.edu