idnits 2.17.1 draft-ietf-acme-acme-09.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 2 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 829 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 (December 14, 2017) is 2326 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 3632 == Missing Reference: 'A-Z' is mentioned on line 581, but not defined == Missing Reference: '0-9' is mentioned on line 581, 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: June 17, 2018 EFF 6 D. McCarney 7 Let's Encrypt 8 J. Kasten 9 University of Michigan 10 December 14, 2017 12 Automatic Certificate Management Environment (ACME) 13 draft-ietf-acme-acme-09 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 June 17, 2018. 53 Copyright Notice 55 Copyright (c) 2017 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 . . . . . . . . . . . . . . . . . . 11 79 6.3.1. "url" (URL) JWS Header Parameter . . . . . . . . . . 12 80 6.4. Replay protection . . . . . . . . . . . . . . . . . . . . 12 81 6.4.1. Replay-Nonce . . . . . . . . . . . . . . . . . . . . 12 82 6.4.2. "nonce" (Nonce) JWS Header Parameter . . . . . . . . 13 83 6.5. Rate Limits . . . . . . . . . . . . . . . . . . . . . . . 13 84 6.6. Errors . . . . . . . . . . . . . . . . . . . . . . . . . 13 85 6.6.1. Subproblems . . . . . . . . . . . . . . . . . . . . . 15 86 7. Certificate Management . . . . . . . . . . . . . . . . . . . 16 87 7.1. Resources . . . . . . . . . . . . . . . . . . . . . . . . 17 88 7.1.1. Directory . . . . . . . . . . . . . . . . . . . . . . 19 89 7.1.2. Account Objects . . . . . . . . . . . . . . . . . . . 21 90 7.1.3. Order Objects . . . . . . . . . . . . . . . . . . . . 22 91 7.1.4. Authorization Objects . . . . . . . . . . . . . . . . 24 92 7.2. Getting a Nonce . . . . . . . . . . . . . . . . . . . . . 26 93 7.3. Account Creation . . . . . . . . . . . . . . . . . . . . 27 94 7.3.1. Finding an Account URL Given a Key . . . . . . . . . 29 95 7.3.2. Account Update . . . . . . . . . . . . . . . . . . . 29 96 7.3.3. Account Information . . . . . . . . . . . . . . . . . 30 97 7.3.4. Changes of Terms of Service . . . . . . . . . . . . . 30 98 7.3.5. External Account Binding . . . . . . . . . . . . . . 30 99 7.3.6. Account Key Roll-over . . . . . . . . . . . . . . . . 33 100 7.3.7. Account Deactivation . . . . . . . . . . . . . . . . 35 101 7.4. Applying for Certificate Issuance . . . . . . . . . . . . 36 102 7.4.1. Pre-Authorization . . . . . . . . . . . . . . . . . . 40 103 7.4.2. Downloading the Certificate . . . . . . . . . . . . . 42 104 7.5. Identifier Authorization . . . . . . . . . . . . . . . . 43 105 7.5.1. Responding to Challenges . . . . . . . . . . . . . . 44 106 7.5.2. Deactivating an Authorization . . . . . . . . . . . . 46 107 7.6. Certificate Revocation . . . . . . . . . . . . . . . . . 47 108 8. Identifier Validation Challenges . . . . . . . . . . . . . . 49 109 8.1. Key Authorizations . . . . . . . . . . . . . . . . . . . 51 110 8.2. Retrying Challenges . . . . . . . . . . . . . . . . . . . 51 111 8.3. HTTP Challenge . . . . . . . . . . . . . . . . . . . . . 52 112 8.4. TLS with Server Name Indication (TLS SNI) Challenge . . . 54 113 8.5. DNS Challenge . . . . . . . . . . . . . . . . . . . . . . 57 114 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 58 115 9.1. MIME Type: application/pem-certificate-chain . . . . . . 58 116 9.2. Well-Known URI for the HTTP Challenge . . . . . . . . . . 59 117 9.3. Replay-Nonce HTTP Header . . . . . . . . . . . . . . . . 59 118 9.4. "url" JWS Header Parameter . . . . . . . . . . . . . . . 60 119 9.5. "nonce" JWS Header Parameter . . . . . . . . . . . . . . 60 120 9.6. URN Sub-namespace for ACME (urn:ietf:params:acme) . . . . 60 121 9.7. New Registries . . . . . . . . . . . . . . . . . . . . . 61 122 9.7.1. Fields in Account Objects . . . . . . . . . . . . . . 61 123 9.7.2. Fields in Order Objects . . . . . . . . . . . . . . . 62 124 9.7.3. Fields in Authorization Objects . . . . . . . . . . . 63 125 9.7.4. Error Types . . . . . . . . . . . . . . . . . . . . . 64 126 9.7.5. Resource Types . . . . . . . . . . . . . . . . . . . 64 127 9.7.6. Fields in the "meta" Object within a Directory Object 65 128 9.7.7. Identifier Types . . . . . . . . . . . . . . . . . . 66 129 9.7.8. Validation Methods . . . . . . . . . . . . . . . . . 66 130 10. Security Considerations . . . . . . . . . . . . . . . . . . . 67 131 10.1. Threat Model . . . . . . . . . . . . . . . . . . . . . . 68 132 10.2. Integrity of Authorizations . . . . . . . . . . . . . . 69 133 10.3. Denial-of-Service Considerations . . . . . . . . . . . . 71 134 10.4. Server-Side Request Forgery . . . . . . . . . . . . . . 72 135 10.5. CA Policy Considerations . . . . . . . . . . . . . . . . 72 136 11. Operational Considerations . . . . . . . . . . . . . . . . . 73 137 11.1. DNS security . . . . . . . . . . . . . . . . . . . . . . 73 138 11.2. Default Virtual Hosts . . . . . . . . . . . . . . . . . 74 139 11.3. Token Entropy . . . . . . . . . . . . . . . . . . . . . 75 140 11.4. Malformed Certificate Chains . . . . . . . . . . . . . . 75 141 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 75 142 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 76 143 13.1. Normative References . . . . . . . . . . . . . . . . . . 76 144 13.2. Informative References . . . . . . . . . . . . . . . . . 78 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 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 be used to associate authorizations with an account that were not 220 validated through the ACME authorization process. This allows ACME 221 to address issuance scenarios that cannot yet be fully automated, 222 such as the issuance of 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. 306 Issuance using ACME resembles a traditional CA's issuance process, in 307 which a user creates an account, requests a certificate, and proves 308 control of the domains in that certificate in order for the CA to 309 sign the requested certificate. 311 The first phase of ACME is for the client to request an account with 312 the ACME server. The client generates an asymmetric key pair and 313 requests a new account, optionally providing contact information, 314 agreeing to terms of service, and/or associating the account with an 315 existing account in another system. The creation request is signed 316 with the generated private key to prove that the client controls it. 318 Client Server 320 Contact Information 321 ToS Agreement 322 Additional Data 323 Signature -------> 325 <------- Account 327 Once an account is registered, there are three major steps the client 328 needs to take to get a certificate: 330 1. Submit an order for a certificate to be issued 332 2. Prove control of any identifiers requested in the certificate 334 3. Await issuance and download the issued certificate 335 The client's order for a certificate describes the desired 336 certificate using a PKCS#10 Certificate Signing Request (CSR) plus a 337 few additional fields that capture semantics that are not supported 338 in the CSR format. If the server is willing to consider issuing such 339 a certificate, it responds with a list of requirements that the 340 client must satisfy before the certificate will be issued. 342 For example, in most cases, the server will require the client to 343 demonstrate that it controls the identifiers in the requested 344 certificate. Because there are many different ways to validate 345 possession of different types of identifiers, the server will choose 346 from an extensible set of challenges that are appropriate for the 347 identifier being claimed. The client responds with a set of 348 responses that tell the server which challenges the client has 349 completed. The server then validates that the client has completed 350 the challenges. 352 Once the validation process is complete and the server is satisfied 353 that the client has met its requirements, the server will issue the 354 requested certificate and make it available to the client. 356 Order 357 Signature -------> 358 <------- Required Authorizations 360 Responses 361 Signature -------> 363 <~~~~~~~~Validation~~~~~~~~> 365 <------- Certificate 367 To revoke a certificate, the client sends a signed revocation request 368 indicating the certificate to be revoked: 370 Client Server 372 Revocation request 373 Signature --------> 375 <-------- Result 377 Note that while ACME is defined with enough flexibility to handle 378 different types of identifiers in principle, the primary use case 379 addressed by this document is the case where domain names are used as 380 identifiers. For example, all of the identifier validation 381 challenges described in Section 8 below address validation of domain 382 names. The use of ACME for other identifiers will require further 383 specification in order to describe how these identifiers are encoded 384 in the protocol and what types of validation challenges the server 385 might require. 387 5. Character Encoding 389 All requests and responses sent via HTTP by ACME clients, ACME 390 servers, and validation servers as well as any inputs for digest 391 computations MUST be encoded using the UTF-8 [RFC3629] character set. 393 6. Message Transport 395 Communications between an ACME client and an ACME server are done 396 over HTTPS, using JSON Web Signature (JWS) [RFC7515] to provide some 397 additional security properties for messages sent from the client to 398 the server. HTTPS provides server authentication and 399 confidentiality. With some ACME-specific extensions, JWS provides 400 authentication of the client's request payloads, anti-replay 401 protection, and integrity for the HTTPS request URL. 403 6.1. HTTPS Requests 405 Each ACME function is accomplished by the client sending a sequence 406 of HTTPS requests to the server, carrying JSON messages 407 [RFC2818][RFC7159]. Use of HTTPS is REQUIRED. Each subsection of 408 Section 7 below describes the message formats used by the function 409 and the order in which messages are sent. 411 In most HTTPS transactions used by ACME, the ACME client is the HTTPS 412 client and the ACME server is the HTTPS server. The ACME server acts 413 as an HTTP and HTTPS client when validating challenges via HTTP. 415 ACME servers SHOULD follow the recommendations of [RFC7525] when 416 configuring their TLS implementations. ACME servers that support TLS 417 1.3 MAY allow clients to send early data (0xRTT). This is safe 418 because the ACME protocol itself includes anti-replay protections 419 (see Section 6.4). 421 ACME clients SHOULD send a User-Agent header in accordance with 422 [RFC7231], including the name and version of the ACME software in 423 addition to the name and version of the underlying HTTP client 424 software. 426 ACME clients SHOULD send an Accept-Language header in accordance with 427 [RFC7231] to enable localization of error messages. 429 ACME servers that are intended to be generally accessible need to use 430 Cross-Origin Resource Sharing (CORS) in order to be accessible from 431 browser-based clients [W3C.CR-cors-20130129]. Such servers SHOULD 432 set the Access-Control-Allow-Origin header field to the value "*". 434 Binary fields in the JSON objects used by ACME are encoded using 435 base64url encoding described in [RFC4648] Section 5, according to the 436 profile specified in JSON Web Signature [RFC7515] Section 2. This 437 encoding uses a URL safe character set. Trailing '=' characters MUST 438 be stripped. 440 6.2. Request Authentication 442 All ACME requests with a non-empty body MUST encapsulate their 443 payload in a JSON Web Signature (JWS) [RFC7515] object, signed using 444 the account's private key unless otherwise specified. The server 445 MUST verify the JWS before processing the request. Encapsulating 446 request bodies in JWS provides authentication of requests. 448 JWS objects sent in ACME requests MUST meet the following additional 449 criteria: 451 o The JWS MUST NOT have the value "none" in its "alg" field 453 o The JWS MUST NOT have a Message Authentication Code (MAC)-based 454 algorithm in its "alg" field 456 o The JWS Protected Header MUST include the following fields: 458 * "alg" (Algorithm) 460 * "jwk" (JSON Web Key, only for requests to new-account and 461 revoke-cert resources) 463 * "kid" (Key ID, for all other requests) 465 * "nonce" (defined in Section 6.4 below) 467 * "url" (defined in Section 6.3 below) 469 The "jwk" and "kid" fields are mutually exclusive. Servers MUST 470 reject requests that contain both. 472 For new-account requests, and for revoke-cert requests authenticated 473 by certificate key, there MUST be a "jwk" field. 475 For all other requests, there MUST be a "kid" field. This field must 476 contain the account URL received by POSTing to the new-account 477 resource. 479 Note that authentication via signed JWS request bodies implies that 480 GET requests are not authenticated. Servers MUST NOT respond to GET 481 requests for resources that might be considered sensitive. Account 482 resources are the only sensitive resources defined in this 483 specification. 485 If the client sends a JWS signed with an algorithm that the server 486 does not support, then the server MUST return an error with status 487 code 400 (Bad Request) and type 488 "urn:ietf:params:acme:error:badSignatureAlgorithm". The problem 489 document returned with the error MUST include an "algorithms" field 490 with an array of supported "alg" values. 492 In the examples below, JWS objects are shown in the JSON or flattened 493 JSON serialization, with the protected header and payload expressed 494 as base64url(content) instead of the actual base64-encoded value, so 495 that the content is readable. 497 6.3. Request URL Integrity 499 It is common in deployment for the entity terminating TLS for HTTPS 500 to be different from the entity operating the logical HTTPS server, 501 with a "request routing" layer in the middle. For example, an ACME 502 CA might have a content delivery network terminate TLS connections 503 from clients so that it can inspect client requests for denial-of- 504 service protection. 506 These intermediaries can also change values in the request that are 507 not signed in the HTTPS request, e.g., the request URL and headers. 508 ACME uses JWS to provide an integrity mechanism, which protects 509 against an intermediary changing the request URL to another ACME URL. 511 As noted in Section 6.2 above, all ACME request objects carry a "url" 512 header parameter in their protected header. This header parameter 513 encodes the URL to which the client is directing the request. On 514 receiving such an object in an HTTP request, the server MUST compare 515 the "url" header parameter to the request URL. If the two do not 516 match, then the server MUST reject the request as unauthorized. 518 Except for the directory resource, all ACME resources are addressed 519 with URLs provided to the client by the server. In requests sent to 520 these resources, the client MUST set the "url" header parameter to 521 the exact string provided by the server (rather than performing any 522 re-encoding on the URL). The server SHOULD perform the corresponding 523 string equality check, configuring each resource with the URL string 524 provided to clients and having the resource check that requests have 525 the same string in their "url" header parameter. 527 6.3.1. "url" (URL) JWS Header Parameter 529 The "url" header parameter specifies the URL [RFC3986] to which this 530 JWS object is directed. The "url" header parameter MUST be carried 531 in the protected header of the JWS. The value of the "url" header 532 parameter MUST be a string representing the URL. 534 6.4. Replay protection 536 In order to protect ACME resources from any possible replay attacks, 537 ACME requests have a mandatory anti-replay mechanism. This mechanism 538 is based on the server maintaining a list of nonces that it has 539 issued to clients, and requiring any signed request from the client 540 to carry such a nonce. 542 An ACME server provides nonces to clients using the Replay-Nonce 543 header field, as specified in Section 6.4.1 below. The server MUST 544 include a Replay-Nonce header field in every successful response to a 545 POST request and SHOULD provide it in error responses as well. 547 Every JWS sent by an ACME client MUST include, in its protected 548 header, the "nonce" header parameter, with contents as defined in 549 Section 6.4.2 below. As part of JWS verification, the ACME server 550 MUST verify that the value of the "nonce" header is a value that the 551 server previously provided in a Replay-Nonce header field. Once a 552 nonce value has appeared in an ACME request, the server MUST consider 553 it invalid, in the same way as a value it had never issued. 555 When a server rejects a request because its nonce value was 556 unacceptable (or not present), it MUST provide HTTP status code 400 557 (Bad Request), and indicate the ACME error type 558 "urn:ietf:params:acme:error:badNonce". An error response with the 559 "badNonce" error type MUST include a Replay-Nonce header with a fresh 560 nonce. On receiving such a response, a client SHOULD retry the 561 request using the new nonce. 563 The precise method used to generate and track nonces is up to the 564 server. For example, the server could generate a random 128-bit 565 value for each response, keep a list of issued nonces, and strike 566 nonces from this list as they are used. 568 6.4.1. Replay-Nonce 570 The "Replay-Nonce" header field includes a server-generated value 571 that the server can use to detect unauthorized replay in future 572 client requests. The server MUST generate the value provided in 573 Replay-Nonce in such a way that they are unique to each message, with 574 high probability. For instance, it is acceptable to generate Replay- 575 Nonces randomly. 577 The value of the Replay-Nonce field MUST be an octet string encoded 578 according to the base64url encoding described in Section 2 of 579 [RFC7515]. Clients MUST ignore invalid Replay-Nonce values. 581 base64url = [A-Z] / [a-z] / [0-9] / "-" / "_" 583 Replay-Nonce = *base64url 585 The Replay-Nonce header field SHOULD NOT be included in HTTP request 586 messages. 588 6.4.2. "nonce" (Nonce) JWS Header Parameter 590 The "nonce" header parameter provides a unique value that enables the 591 verifier of a JWS to recognize when replay has occurred. The "nonce" 592 header parameter MUST be carried in the protected header of the JWS. 594 The value of the "nonce" header parameter MUST be an octet string, 595 encoded according to the base64url encoding described in Section 2 of 596 [RFC7515]. If the value of a "nonce" header parameter is not valid 597 according to this encoding, then the verifier MUST reject the JWS as 598 malformed. 600 6.5. Rate Limits 602 Creation of resources can be rate limited by ACME servers to ensure 603 fair usage and prevent abuse. Once the rate limit is exceeded, the 604 server MUST respond with an error with the type 605 "urn:ietf:params:acme:error:rateLimited". Additionally, the server 606 SHOULD send a "Retry-After" header indicating when the current 607 request may succeed again. If multiple rate limits are in place, 608 that is the time where all rate limits allow access again for the 609 current request with exactly the same parameters. 611 In addition to the human-readable "detail" field of the error 612 response, the server MAY send one or multiple link relations in the 613 "Link" header pointing to documentation about the specific rate limit 614 that was hit, using the "help" link relation type. 616 6.6. Errors 618 Errors can be reported in ACME both at the HTTP layer and within 619 challenge objects as defined in Section 8. ACME servers can return 620 responses with an HTTP error response code (4XX or 5XX). For 621 example: If the client submits a request using a method not allowed 622 in this document, then the server MAY return status code 405 (Method 623 Not Allowed). 625 When the server responds with an error status, it SHOULD provide 626 additional information using a problem document [RFC7807]. To 627 facilitate automatic response to errors, this document defines the 628 following standard tokens for use in the "type" field (within the 629 "urn:ietf:params:acme:error:" namespace): 631 +-------------------------+-----------------------------------------+ 632 | Type | Description | 633 +-------------------------+-----------------------------------------+ 634 | badCSR | The CSR is unacceptable (e.g., due to a | 635 | | short key) | 636 | | | 637 | badNonce | The client sent an unacceptable anti- | 638 | | replay nonce | 639 | | | 640 | badSignatureAlgorithm | The JWS was signed with an algorithm | 641 | | the server does not support | 642 | | | 643 | invalidContact | A contact URL for an account was | 644 | | invalid | 645 | | | 646 | unsupportedContact | A contact URL for an account used an | 647 | | unsupported protocol scheme | 648 | | | 649 | externalAccountRequired | The request must include a value for | 650 | | the "externalAccountBinding" field | 651 | | | 652 | accountDoesNotExist | The request specified an account that | 653 | | does not exist | 654 | | | 655 | malformed | The request message was malformed | 656 | | | 657 | rateLimited | The request exceeds a rate limit | 658 | | | 659 | rejectedIdentifier | The server will not issue for the | 660 | | identifier | 661 | | | 662 | serverInternal | The server experienced an internal | 663 | | error | 664 | | | 665 | unauthorized | The client lacks sufficient | 666 | | authorization | 667 | | | 668 | unsupportedIdentifier | Identifier is not supported, but may be | 669 | | in future | 670 | | | 671 | userActionRequired | Visit the "instance" URL and take | 672 | | actions specified there | 673 | | | 674 | badRevocationReason | The revocation reason provided is not | 675 | | allowed by the server | 676 | | | 677 | caa | Certification Authority Authorization | 678 | | (CAA) records forbid the CA from | 679 | | issuing | 680 | | | 681 | dns | There was a problem with a DNS query | 682 | | | 683 | connection | The server could not connect to | 684 | | validation target | 685 | | | 686 | tls | The server received a TLS error during | 687 | | validation | 688 | | | 689 | incorrectResponse | Response received didn't match the | 690 | | challenge's requirements | 691 +-------------------------+-----------------------------------------+ 693 This list is not exhaustive. The server MAY return errors whose 694 "type" field is set to a URI other than those defined above. Servers 695 MUST NOT use the ACME URN [RFC3553] namespace for errors other than 696 the standard types. Clients SHOULD display the "detail" field of all 697 errors. 699 In the remainder of this document, we use the tokens in the table 700 above to refer to error types, rather than the full URNs. For 701 example, an "error of type 'badCSR'" refers to an error document with 702 "type" value "urn:ietf:params:acme:error:badCSR". 704 6.6.1. Subproblems 706 Sometimes a CA may need to return multiple errors in response to a 707 request. Additionally, the CA may need to attribute errors to 708 specific identifiers. For instance, a new-order request may contain 709 multiple identifiers for which the CA cannot issue. In this 710 situation, an ACME problem document MAY contain the "subproblems" 711 field, containing a JSON array of problem documents, each of which 712 MAY contain an "identifier" field. If present, the "identifier" 713 field MUST contain an ACME identifier (Section 9.7.7). The 714 "identifier" field MUST NOT be present at the top level in ACME 715 problem documents. It can only be present in subproblems. 716 Subproblems need not all have the same type, and do not need to match 717 the top level type. 719 ACME clients may choose to use the "identifier" field of a subproblem 720 as a hint that an operation would succeed if that identifier were 721 omitted. For instance, if an order contains ten DNS identifiers, and 722 the new-order request returns a problem document with two 723 subproblems, referencing two of those identifiers, the ACME client 724 may choose to submit another order containing only the eight 725 identifiers not listed in the problem document. 727 HTTP/1.1 403 Forbidden 728 Content-Type: application/problem+json 730 { 731 "type": "urn:ietf:params:acme:error:malformed", 732 "detail": "Some of the identifiers requested were rejected", 733 "subproblems": [ 734 { 735 "type": "urn:ietf:params:acme:error:malformed", 736 "detail": "Invalid underscore in DNS name \"_example.com\"", 737 "identifier": { 738 "type": "dns", 739 "value": "_example.com" 740 } 741 }, 742 { 743 "type": "urn:ietf:params:acme:error:rejectedIdentifier", 744 "detail": "This CA will not issue for \"example.net\"", 745 "identifier": { 746 "type": "dns", 747 "value": "example.net" 748 } 749 } 750 ] 751 } 753 7. Certificate Management 755 In this section, we describe the certificate management functions 756 that ACME enables: 758 o Account Creation 760 o Ordering a Certificate 762 o Identifier Authorization 764 o Certificate Issuance 766 o Certificate Revocation 768 7.1. Resources 770 ACME is structured as a REST application with the following types of 771 resources: 773 o Account resources, representing information about an account 774 (Section 7.1.2, Section 7.3) 776 o Order resources, representing an account's requests to issue 777 certificates (Section 7.1.3) 779 o Authorization resources, representing an account's authorization 780 to act for an identifier (Section 7.1.4) 782 o Challenge resources, representing a challenge to prove control of 783 an identifier (Section 7.5, Section 8) 785 o Certificate resources, representing issued certificates 786 (Section 7.4.2) 788 o A "directory" resource (Section 7.1.1) 790 o A "newNonce" resource (Section 7.2) 792 o A "newAccount" resource (Section 7.3) 794 o A "newOrder" resource (Section 7.4) 796 o A "revokeCert" resource (Section 7.6) 798 o A "keyChange" resource (Section 7.3.6) 800 The server MUST provide "directory" and "newNonce" resources. 802 ACME uses different URLs for different management functions. Each 803 function is listed in a directory along with its corresponding URL, 804 so clients only need to be configured with the directory URL. These 805 URLs are connected by a few different link relations [RFC5988]. 807 The "up" link relation is used with challenge resources to indicate 808 the authorization resource to which a challenge belongs. It is also 809 used from certificate resources to indicate a resource from which the 810 client may fetch a chain of CA certificates that could be used to 811 validate the certificate in the original resource. 813 The "index" link relation is present on all resources other than the 814 directory and indicates the URL of the directory. 816 The following diagram illustrates the relations between resources on 817 an ACME server. For the most part, these relations are expressed by 818 URLs provided as strings in the resources' JSON representations. 819 Lines with labels in quotes indicate HTTP link relations. 821 directory 822 | 823 +--> new-nonce 824 | 825 +----------+----------+-----+-----+------------+ 826 | | | | | 827 | | | | | 828 V V V V V 829 newAccount newAuthz newOrder revokeCert keyChange 830 | | | 831 | | | 832 V | V 833 account | order -----> cert 834 | | 835 | | 836 | V 837 +------> authz 838 | ^ 839 | | "up" 840 V | 841 challenge 843 The following table illustrates a typical sequence of requests 844 required to establish a new account with the server, prove control of 845 an identifier, issue a certificate, and fetch an updated certificate 846 some time after issuance. The "->" is a mnemonic for a Location 847 header pointing to a created resource. 849 +----------------------+---------------------+----------------+ 850 | Action | Request | Response | 851 +----------------------+---------------------+----------------+ 852 | Get a nonce | HEAD newNonce | 204 | 853 | | | | 854 | Create account | POST newAccount | 201 -> account | 855 | | | | 856 | Submit an order | POST newOrder | 201 -> order | 857 | | | | 858 | Fetch challenges | GET authz | 200 | 859 | | | | 860 | Respond to challenge | POST challenge | 200 | 861 | | | | 862 | Finalize order | POST order finalize | 200 | 863 | | | | 864 | Poll for status | GET authz | 200 | 865 | | | | 866 | Check for new cert | GET cert | 200 | 867 +----------------------+---------------------+----------------+ 869 The remainder of this section provides the details of how these 870 resources are structured and how the ACME protocol makes use of them. 872 7.1.1. Directory 874 In order to help clients configure themselves with the right URLs for 875 each ACME operation, ACME servers provide a directory object. This 876 should be the only URL needed to configure clients. It is a JSON 877 object, whose field names are drawn from the following table and 878 whose values are the corresponding URLs. 880 +------------+--------------------+ 881 | Field | URL in value | 882 +------------+--------------------+ 883 | newNonce | New nonce | 884 | | | 885 | newAccount | New account | 886 | | | 887 | newOrder | New order | 888 | | | 889 | newAuthz | New authorization | 890 | | | 891 | revokeCert | Revoke certificate | 892 | | | 893 | keyChange | Key change | 894 +------------+--------------------+ 896 There is no constraint on the URL of the directory except that it 897 should be different from the other ACME server resources' URLs, and 898 that it should not clash with other services. For instance: 900 o a host which functions as both an ACME and a Web server may want 901 to keep the root path "/" for an HTML "front page", and place the 902 ACME directory under the path "/acme". 904 o a host which only functions as an ACME server could place the 905 directory under the path "/". 907 The object MAY additionally contain a field "meta". If present, it 908 MUST be a JSON object; each field in the object is an item of 909 metadata relating to the service provided by the ACME server. 911 The following metadata items are defined, all of which are OPTIONAL: 913 termsOfService (optional, string): A URL identifying the current 914 terms of service. 916 website (optional, string): An HTTP or HTTPS URL locating a website 917 providing more information about the ACME server. 919 caaIdentities (optional, array of string): Each string MUST be a 920 lowercase hostname which the ACME server recognizes as referring 921 to itself for the purposes of CAA record validation as defined in 922 [RFC6844]. This allows clients to determine the correct issuer 923 domain name to use when configuring CAA records. 925 externalAccountRequired (optional, boolean): If this field is 926 present and set to "true", then the CA requires that all new- 927 account requests include an "externalAccountBinding" field 928 associating the new account with an external account. 930 Clients access the directory by sending a GET request to the 931 directory URL. 933 HTTP/1.1 200 OK 934 Content-Type: application/json 936 { 937 "newNonce": "https://example.com/acme/new-nonce", 938 "newAccount": "https://example.com/acme/new-account", 939 "newOrder": "https://example.com/acme/new-order", 940 "newAuthz": "https://example.com/acme/new-authz", 941 "revokeCert": "https://example.com/acme/revoke-cert", 942 "keyChange": "https://example.com/acme/key-change", 943 "meta": { 944 "termsOfService": "https://example.com/acme/terms/2017-5-30", 945 "website": "https://www.example.com/", 946 "caaIdentities": ["example.com"], 947 "externalAccountRequired": false 948 } 949 } 951 7.1.2. Account Objects 953 An ACME account resource represents a set of metadata associated with 954 an account. Account resources have the following structure: 956 status (required, string): The status of this account. Possible 957 values are: "valid", "deactivated", and "revoked". The value 958 "deactivated" should be used to indicate client-initiated 959 deactivation whereas "revoked" should be used to indicate server- 960 initiated deactivation. 962 contact (optional, array of string): An array of URLs that the 963 server can use to contact the client for issues related to this 964 account. For example, the server may wish to notify the client 965 about server-initiated revocation or certificate expiration. 967 termsOfServiceAgreed (optional, boolean): Including this field in a 968 new-account request, with a value of true, indicates the client's 969 agreement with the terms of service. This field is not updateable 970 by the client. 972 orders (required, string): A URL from which a list of orders 973 submitted by this account can be fetched via a GET request, as 974 described in Section 7.1.2.1. 976 { 977 "status": "valid", 978 "contact": [ 979 "mailto:cert-admin@example.com", 980 "mailto:admin@example.com" 981 ], 982 "termsOfServiceAgreed": true, 983 "orders": "https://example.com/acme/acct/1/orders" 984 } 986 7.1.2.1. Orders List 988 Each account object includes an "orders" URL from which a list of 989 orders created by the account can be fetched via GET request. The 990 result of the GET request MUST be a JSON object whose "orders" field 991 is an array of URLs, each identifying an order belonging to the 992 account. The server SHOULD include pending orders, and SHOULD NOT 993 include orders that are invalid in the array of URLs. The server MAY 994 return an incomplete list, along with a Link header with a "next" 995 link relation indicating where further entries can be acquired. 997 HTTP/1.1 200 OK 998 Content-Type: application/json 999 Link: , rel="next" 1001 { 1002 "orders": [ 1003 "https://example.com/acme/acct/1/order/1", 1004 "https://example.com/acme/acct/1/order/2", 1005 /* 47 more URLs not shown for example brevity */ 1006 "https://example.com/acme/acct/1/order/50" 1007 ] 1008 } 1010 7.1.3. Order Objects 1012 An ACME order object represents a client's request for a certificate 1013 and is used to track the progress of that order through to issuance. 1014 Thus, the object contains information about the requested 1015 certificate, the authorizations that the server requires the client 1016 to complete, and any certificates that have resulted from this order. 1018 status (required, string): The status of this order. Possible 1019 values are: "pending", "processing", "valid", and "invalid". 1021 expires (optional, string): The timestamp after which the server 1022 will consider this order invalid, encoded in the format specified 1023 in RFC 3339 [RFC3339]. This field is REQUIRED for objects with 1024 "pending" or "valid" in the status field. 1026 identifiers (required, array of object): An array of identifier 1027 objects that the order pertains to. 1029 type (required, string): The type of identifier. 1031 value (required, string): The identifier itself. 1033 notBefore (optional, string): The requested value of the notBefore 1034 field in the certificate, in the date format defined in [RFC3339]. 1036 notAfter (optional, string): The requested value of the notAfter 1037 field in the certificate, in the date format defined in [RFC3339]. 1039 error (optional, object): The error that occurred while processing 1040 the order, if any. This field is structured as a problem document 1041 [RFC7807]. 1043 authorizations (required, array of string): For pending orders, the 1044 authorizations that the client needs to complete before the 1045 requested certificate can be issued (see Section 7.5). For final 1046 orders (in the "valid" or "invalid" state), the authorizations 1047 that were completed. Each entry is a URL from which an 1048 authorization can be fetched with a GET request. 1050 finalize (requred, string): A URL that a CSR must be POSTed to once 1051 all of the order's authorizations are satisfied to finalize the 1052 order. The result of a successful finalization will be the 1053 population of the certificate URL for the order. 1055 certificate (optional, string): A URL for the certificate that has 1056 been issued in response to this order. 1058 { 1059 "status": "valid", 1060 "expires": "2015-03-01T14:09:00Z", 1062 "identifiers": [ 1063 { "type": "dns", "value": "example.com" }, 1064 { "type": "dns", "value": "www.example.com" } 1065 ], 1067 "notBefore": "2016-01-01T00:00:00Z", 1068 "notAfter": "2016-01-08T00:00:00Z", 1070 "authorizations": [ 1071 "https://example.com/acme/authz/1234", 1072 "https://example.com/acme/authz/2345" 1073 ], 1075 "finalize": "https://example.com/acme/acct/1/order/1/finalize", 1077 "certificate": "https://example.com/acme/cert/1234" 1078 } 1080 Any identifier of type "dns" in a new-order request MAY have a 1081 wildcard domain name as its value. A wildcard domain name consists 1082 of a single asterisk character followed by a single full stop 1083 character ("_.") followed by a domain name as defined for use in the 1084 Subject Alternate Name Extension by RFC 5280 . An authorization 1085 returned by the server for a wildcard domain name identifier MUST NOT 1086 include the asterisk and full stop ("_[RFC5280].") prefix in the 1087 authorization identifier value. 1089 The elements of the "authorizations" and "identifiers" array are 1090 immutable once set. The server MUST NOT change the contents either 1091 array after they are created. If a client observes a change in the 1092 contents of either array, then it SHOULD consider the order invalid. 1094 The "authorizations" array in the challenge SHOULD reflect all 1095 authorizations that the CA takes into account in deciding to issue, 1096 even if some authorizations were fulfilled in earlier orders or in 1097 pre-authorization transactions. For example, if a CA allows multiple 1098 orders to be fulfilled based on a single authorization transaction, 1099 then it SHOULD reflect that authorization in all of the orders. 1101 7.1.4. Authorization Objects 1103 An ACME authorization object represents a server's authorization for 1104 an account to represent an identifier. In addition to the 1105 identifier, an authorization includes several metadata fields, such 1106 as the status of the authorization (e.g., "pending", "valid", or 1107 "revoked") and which challenges were used to validate possession of 1108 the identifier. 1110 The structure of an ACME authorization resource is as follows: 1112 identifier (required, object): The identifier that the account is 1113 authorized to represent 1115 type (required, string): The type of identifier. 1117 value (required, string): The identifier itself. 1119 status (required, string): The status of this authorization. 1120 Possible values are: "pending", "processing", "valid", "invalid" 1121 and "revoked". 1123 expires (optional, string): The timestamp after which the server 1124 will consider this authorization invalid, encoded in the format 1125 specified in RFC 3339 [RFC3339]. This field is REQUIRED for 1126 objects with "valid" in the "status" field. 1128 challenges (required, array of objects): For pending authorizations, 1129 the challenges that the client can fulfill in order to prove 1130 possession of the identifier. For final authorizations (in the 1131 "valid" or "invalid" state), the challenges that were used. Each 1132 array entry is an object with parameters required to validate the 1133 challenge. A client should attempt to fulfill one of these 1134 challenges, and a server should consider any one of the challenges 1135 sufficient to make the authorization valid. For final 1136 authorizations, it contains the challenges that were successfully 1137 completed. 1139 The only type of identifier defined by this specification is a fully- 1140 qualified domain name (type: "dns"). If a domain name contains non- 1141 ASCII Unicode characters it MUST be encoded using the rules defined 1142 in [RFC3492]. Servers MUST verify any identifier values that begin 1143 with the ASCII Compatible Encoding prefix "xn-" as defined in 1144 [RFC5890] are properly encoded. Wildcard domain names (with "*" as 1145 the first label) MUST NOT be included in authorization objects. 1147 Section 8 describes a set of challenges for domain name validation. 1149 { 1150 "status": "valid", 1151 "expires": "2015-03-01T14:09:00Z", 1153 "identifier": { 1154 "type": "dns", 1155 "value": "example.org" 1156 }, 1158 "challenges": [ 1159 { 1160 "url": "https://example.com/acme/authz/1234/0", 1161 "type": "http-01", 1162 "status": "valid", 1163 "token": "DGyRejmCefe7v4NfDGDKfA" 1164 "validated": "2014-12-01T12:05:00Z", 1165 "keyAuthorization": "SXQe-2XODaDxNR...vb29HhjjLPSggwiE" 1166 } 1167 ] 1168 } 1170 7.2. Getting a Nonce 1172 Before sending a POST request to the server, an ACME client needs to 1173 have a fresh anti-replay nonce to put in the "nonce" header of the 1174 JWS. In most cases, the client will have gotten a nonce from a 1175 previous request. However, the client might sometimes need to get a 1176 new nonce, e.g., on its first request to the server or if an existing 1177 nonce is no longer valid. 1179 To get a fresh nonce, the client sends a HEAD request to the new- 1180 nonce resource on the server. The server's response MUST include a 1181 Replay-Nonce header field containing a fresh nonce, and SHOULD have 1182 status code 204 (No Content). The server SHOULD also respond to GET 1183 requests for this resource, returning an empty body (while still 1184 providing a Replay-Nonce header) with a 204 (No Content) status. 1186 HEAD /acme/new-nonce HTTP/1.1 1187 Host: example.com 1189 HTTP/1.1 204 No Content 1190 Replay-Nonce: oFvnlFP1wIhRlYS2jTaXbA 1191 Cache-Control: no-store 1193 Proxy caching of responses from the new-nonce resource can cause 1194 clients receive the same nonce repeatedly, leading to badNonce 1195 errors. The server MUST include a Cache-Control header field with 1196 the "no-store" directive in responses for the new-nonce resource, in 1197 order to prevent caching of this resource. 1199 7.3. Account Creation 1201 A client creates a new account with the server by sending a POST 1202 request to the server's new-account URL. The body of the request is 1203 a stub account object containing the "contact" field and optionally 1204 the "termsOfServiceAgreed" field. 1206 contact (optional, array of string): Same meaning as the 1207 corresponding server field defined in Section 7.1.2 1209 termsOfServiceAgreed (optional, boolean): Same meaning as the 1210 corresponding server field defined in Section 7.1.2 1212 onlyReturnExisting (optional, boolean): If this field is present 1213 with the value "true", then the server MUST NOT create a new 1214 account if one does not already exist. This allows a client to 1215 look up an account URL based on an account key (see 1216 Section 7.3.1). 1218 POST /acme/new-account HTTP/1.1 1219 Host: example.com 1220 Content-Type: application/jose+json 1222 { 1223 "protected": base64url({ 1224 "alg": "ES256", 1225 "jwk": {...}, 1226 "nonce": "6S8IqOGY7eL2lsGoTZYifg", 1227 "url": "https://example.com/acme/new-account" 1228 }), 1229 "payload": base64url({ 1230 "termsOfServiceAgreed": true, 1231 "contact": [ 1232 "mailto:cert-admin@example.com", 1233 "mailto:admin@example.com" 1234 ] 1235 }), 1236 "signature": "RZPOnYoPs1PhjszF...-nh6X1qtOFPB519I" 1237 } 1239 The server MUST ignore any values provided in the "orders" fields in 1240 account bodies sent by the client, as well as any other fields that 1241 it does not recognize. If new fields are specified in the future, 1242 the specification of those fields MUST describe whether they can be 1243 provided by the client. 1245 In general, the server MUST ignore any fields in the request object 1246 that it does not recognize. In particular, it MUST NOT reflect 1247 unrecognized fields in the resulting account object. This allows 1248 clients to detect when servers do not support an extension field. 1250 The server SHOULD validate that the contact URLs in the "contact" 1251 field are valid and supported by the server. If the server validates 1252 contact URLs it MUST support the "mailto" scheme. Clients MUST NOT 1253 provide a "mailto" URL in the "contact" field that contains "hfields" 1254 [RFC6068], or more than one "addr-spec" in the "to" component. If a 1255 server encounters a "mailto" contact URL that does not meet these 1256 criteria, then it SHOULD reject it as invalid. 1258 If the server rejects a contact URL for using an unsupported scheme 1259 it MUST return an error of type "unsupportedContact", with a 1260 description describing the error and what types of contact URLs the 1261 server considers acceptable. If the server rejects a contact URL for 1262 using a supported scheme but an invalid value then the server MUST 1263 return an error of type "invalidContact". 1265 If the server wishes to present the client with terms under which the 1266 ACME service is to be used, it MUST indicate the URL where such terms 1267 can be accessed in the "termsOfService" subfield of the "meta" field 1268 in the directory object, and the server MUST reject new-account 1269 requests that do not have the "termsOfServiceAgreed" set to "true". 1270 Clients SHOULD NOT automatically agree to terms by default. Rather, 1271 they SHOULD require some user interaction for agreement to terms. 1273 The server creates an account and stores the public key used to 1274 verify the JWS (i.e., the "jwk" element of the JWS header) to 1275 authenticate future requests from the account. The server returns 1276 this account object in a 201 (Created) response, with the account URL 1277 in a Location header field. 1279 HTTP/1.1 201 Created 1280 Content-Type: application/json 1281 Replay-Nonce: D8s4D2mLs8Vn-goWuPQeKA 1282 Location: https://example.com/acme/acct/1 1283 Link: ;rel="index" 1285 { 1286 "status": "valid", 1288 "contact": [ 1289 "mailto:cert-admin@example.com", 1290 "mailto:admin@example.com" 1291 ] 1292 } 1294 7.3.1. Finding an Account URL Given a Key 1296 If the server already has an account registered with the provided 1297 account key, then it MUST return a response with a 200 (OK) status 1298 code and provide the URL of that account in the Location header 1299 field. This allows a client that has an account key but not the 1300 corresponding account URL to recover the account URL. 1302 If a client wishes to find the URL for an existing account and does 1303 not want an account to be created if one does not already exist, then 1304 it SHOULD do so by sending a POST request to the new-account URL with 1305 a JWS whose payload has an "onlyReturnExisting" field set to "true" 1306 ({"onlyReturnExisting": true}). If a client sends such a request and 1307 an account does not exist, then the server MUST return an error 1308 response with status code 400 (Bad Request) and type 1309 "urn:ietf:params:acme:error:accountDoesNotExist". 1311 7.3.2. Account Update 1313 If the client wishes to update this information in the future, it 1314 sends a POST request with updated information to the account URL. 1315 The server MUST ignore any updates to "order" fields or any other 1316 fields it does not recognize. If the server accepts the update, it 1317 MUST return a response with a 200 (OK) status code and the resulting 1318 account object. 1320 For example, to update the contact information in the above account, 1321 the client could send the following request: 1323 POST /acme/acct/1 HTTP/1.1 1324 Host: example.com 1325 Content-Type: application/jose+json 1327 { 1328 "protected": base64url({ 1329 "alg": "ES256", 1330 "kid": "https://example.com/acme/acct/1", 1331 "nonce": "ax5RnthDqp_Yf4_HZnFLmA", 1332 "url": "https://example.com/acme/acct/1" 1333 }), 1334 "payload": base64url({ 1335 "contact": [ 1336 "mailto:certificates@example.com", 1337 "mailto:admin@example.com" 1338 ] 1339 }), 1340 "signature": "hDXzvcj8T6fbFbmn...rDzXzzvzpRy64N0o" 1341 } 1343 7.3.3. Account Information 1345 Servers SHOULD NOT respond to GET requests for account resources as 1346 these requests are not authenticated. If a client wishes to query 1347 the server for information about its account (e.g., to examine the 1348 "contact" or "certificates" fields), then it SHOULD do so by sending 1349 a POST request with an empty update. That is, it should send a JWS 1350 whose payload is an empty object ({}). 1352 7.3.4. Changes of Terms of Service 1354 As described above, a client can indicate its agreement with the CA's 1355 terms of service by setting the "termsOfServiceAgreed" field in its 1356 account object to "true". 1358 If the server has changed its terms of service since a client 1359 initially agreed, and the server is unwilling to process a request 1360 without explicit agreement to the new terms, then it MUST return an 1361 error response with status code 403 (Forbidden) and type 1362 "urn:ietf:params:acme:error:userActionRequired". This response MUST 1363 include a Link header with link relation "terms-of-service" and the 1364 latest terms-of-service URL. 1366 The problem document returned with the error MUST also include an 1367 "instance" field, indicating a URL that the client should direct a 1368 human user to visit in order for instructions on how to agree to the 1369 terms. 1371 HTTP/1.1 403 Forbidden 1372 Replay-Nonce: IXVHDyxIRGcTE0VSblhPzw 1373 Link: ;rel="terms-of-service" 1374 Content-Type: application/problem+json 1375 Content-Language: en 1377 { 1378 "type": "urn:ietf:params:acme:error:userActionRequired", 1379 "detail": "Terms of service have changed", 1380 "instance": "https://example.com/acme/agreement/?token=W8Ih3PswD-8" 1381 } 1383 7.3.5. External Account Binding 1385 The server MAY require a value for the "externalAccountBinding" field 1386 to be present in "newAccount" requests. This can be used to 1387 associate an ACME account with an existing account in a non-ACME 1388 system, such as a CA customer database. 1390 To enable ACME account binding, a CA needs to provide the ACME client 1391 with a MAC key and a key identifier, using some mechanism outside of 1392 ACME. The key identifier MUST be an ASCII string. The MAC key 1393 SHOULD be provided in base64url-encoded form, to maximize 1394 compatibility between non-ACME provisioning systems and ACME clients. 1396 The ACME client then computes a binding JWS to indicate the external 1397 account holder's approval of the ACME account key. The payload of 1398 this JWS is the account key being registered, in JWK form. The 1399 protected header of the JWS MUST meet the following criteria: 1401 o The "alg" field MUST indicate a MAC-based algorithm 1403 o The "kid" field MUST contain the key identifier provided by the CA 1405 o The "nonce" field MUST NOT be present 1407 o The "url" field MUST be set to the same value as the outer JWS 1409 The "signature" field of the JWS will contain the MAC value computed 1410 with the MAC key provided by the CA. 1412 POST /acme/new-account HTTP/1.1 1413 Host: example.com 1414 Content-Type: application/jose+json 1416 { 1417 "protected": base64url({ 1418 "alg": "ES256", 1419 "jwk": /* account key */, 1420 "nonce": "K60BWPrMQG9SDxBDS_xtSw", 1421 "url": "https://example.com/acme/new-account" 1422 }), 1423 "payload": base64url({ 1424 "contact": ["mailto:example@anonymous.invalid"], 1425 "termsOfServiceAgreed": true, 1427 "externalAccountBinding": { 1428 "protected": base64url({ 1429 "alg": "HS256", 1430 "kid": /* key identifier from CA */, 1431 "url": "https://example.com/acme/new-account" 1432 }), 1433 "payload": base64url(/* same as in "jwk" above */), 1434 "signature": /* MAC using MAC key from CA */ 1435 } 1436 }), 1437 "signature": "5TWiqIYQfIDfALQv...x9C2mg8JGPxl5bI4" 1438 } 1440 If a CA requires that new-account requests contain an 1441 "externalAccountBinding" field, then it MUST provide the value "true" 1442 in the "externalAccountRequired" subfield of the "meta" field in the 1443 directory object. If the CA receives a new-account request without 1444 an "externalAccountBinding" field, then it should reply with an error 1445 of type "externalAccountRequired". 1447 When a CA receives a new-account request containing an 1448 "externalAccountBinding" field, it decides whether or not to verify 1449 the binding. If the CA does not verify the binding, then it MUST NOT 1450 reflect the "externalAccountBinding" field in the resulting account 1451 object (if any). To verify the account binding, the CA MUST take the 1452 following steps: 1454 1. Verify that the value of the field is a well-formed JWS 1456 2. Verify that the JWS protected meets the above criteria 1458 3. Retrieve the MAC key corresponding to the key identifier in the 1459 "kid" field 1461 4. Verify that the MAC on the JWS verifies using that MAC key 1463 5. Verify that the payload of the JWS represents the same key as was 1464 used to verify the outer JWS (i.e., the "jwk" field of the outer 1465 JWS) 1467 If all of these checks pass and the CA creates a new account, then 1468 the CA may consider the new account associated with the external 1469 account corresponding to the MAC key and MUST reflect the value of 1470 the "externalAccountBinding" field in the resulting account object. 1471 If any of these checks fail, then the CA MUST reject the new-account 1472 request. 1474 7.3.6. Account Key Roll-over 1476 A client may wish to change the public key that is associated with an 1477 account in order to recover from a key compromise or proactively 1478 mitigate the impact of an unnoticed key compromise. 1480 To change the key associated with an account, the client first 1481 constructs a key-change object describing the change that it would 1482 like the server to make: 1484 account (required, string): The URL for account being modified. The 1485 content of this field MUST be the exact string provided in the 1486 Location header field in response to the new-account request that 1487 created the account. 1489 newKey (required, JWK): The JWK representation of the new key 1491 The client then encapsulates the key-change object in an "inner" JWS, 1492 signed with the requested new account key (i.e., the key matching the 1493 "newKey" value). This JWS then becomes the payload for the "outer" 1494 JWS that is the body of the ACME request. 1496 The outer JWS MUST meet the normal requirements for an ACME JWS (see 1497 Section 6.2). The inner JWS MUST meet the normal requirements, with 1498 the following differences: 1500 o The inner JWS MUST have a "jwk" header parameter, containing the 1501 public key of the new key pair (i.e., the same value as the 1502 "newKey" field). 1504 o The inner JWS MUST have the same "url" header parameter as the 1505 outer JWS. 1507 o The inner JWS is NOT REQUIRED to have a "nonce" header parameter. 1508 The server MUST ignore any value provided for the "nonce" header 1509 parameter. 1511 This transaction has signatures from both the old and new keys so 1512 that the server can verify that the holders of the two keys both 1513 agree to the change. The signatures are nested to preserve the 1514 property that all signatures on POST messages are signed by exactly 1515 one key. 1517 POST /acme/key-change HTTP/1.1 1518 Host: example.com 1519 Content-Type: application/jose+json 1521 { 1522 "protected": base64url({ 1523 "alg": "ES256", 1524 "kid": "https://example.com/acme/acct/1", 1525 "nonce": "K60BWPrMQG9SDxBDS_xtSw", 1526 "url": "https://example.com/acme/key-change" 1527 }), 1528 "payload": base64url({ 1529 "protected": base64url({ 1530 "alg": "ES256", 1531 "jwk": /* new key */, 1532 "url": "https://example.com/acme/key-change" 1533 }), 1534 "payload": base64url({ 1535 "account": "https://example.com/acme/acct/1", 1536 "newKey": /* new key */ 1537 }), 1538 "signature": "Xe8B94RD30Azj2ea...8BmZIRtcSKPSd8gU" 1539 }), 1540 "signature": "5TWiqIYQfIDfALQv...x9C2mg8JGPxl5bI4" 1541 } 1543 On receiving key-change request, the server MUST perform the 1544 following steps in addition to the typical JWS validation: 1546 1. Validate the POST request belongs to a currently active account, 1547 as described in Section 6. 1549 2. Check that the payload of the JWS is a well-formed JWS object 1550 (the "inner JWS"). 1552 3. Check that the JWS protected header of the inner JWS has a "jwk" 1553 field. 1555 4. Check that the inner JWS verifies using the key in its "jwk" 1556 field. 1558 5. Check that the payload of the inner JWS is a well-formed key- 1559 change object (as described above). 1561 6. Check that the "url" parameters of the inner and outer JWSs are 1562 the same. 1564 7. Check that the "account" field of the key-change object contains 1565 the URL for the account matching the old key 1567 8. Check that the "newKey" field of the key-change object also 1568 verifies the inner JWS. 1570 9. Check that no account exists whose account key is the same as the 1571 key in the "newKey" field. 1573 If all of these checks pass, then the server updates the 1574 corresponding account by replacing the old account key with the new 1575 public key and returns status code 200 (OK). Otherwise, the server 1576 responds with an error status code and a problem document describing 1577 the error. If there is an existing account with the new key 1578 provided, then the server SHOULD use status code 409 (Conflict) and 1579 provide the URL of that account in the Location header field. 1581 Note that changing the account key for an account SHOULD NOT have any 1582 other impact on the account. For example, the server MUST NOT 1583 invalidate pending orders or authorization transactions based on a 1584 change of account key. 1586 7.3.7. Account Deactivation 1588 A client can deactivate an account by posting a signed update to the 1589 server with a status field of "deactivated." Clients may wish to do 1590 this when the account key is compromised or decommissioned. 1592 POST /acme/acct/1 HTTP/1.1 1593 Host: example.com 1594 Content-Type: application/jose+json 1596 { 1597 "protected": base64url({ 1598 "alg": "ES256", 1599 "kid": "https://example.com/acme/acct/1", 1600 "nonce": "ntuJWWSic4WVNSqeUmshgg", 1601 "url": "https://example.com/acme/acct/1" 1602 }), 1603 "payload": base64url({ 1604 "status": "deactivated" 1605 }), 1606 "signature": "earzVLd3m5M4xJzR...bVTqn7R08AKOVf3Y" 1607 } 1609 The server MUST verify that the request is signed by the account key. 1610 If the server accepts the deactivation request, it replies with a 200 1611 (OK) status code and the current contents of the account object. 1613 Once an account is deactivated, the server MUST NOT accept further 1614 requests authorized by that account's key. The server SHOULD cancel 1615 any pending operations authorized by the account's key, such as 1616 certificate orders. A server may take a variety of actions in 1617 response to an account deactivation, e.g., deleting data related to 1618 that account or sending mail to the account's contacts. Servers 1619 SHOULD NOT revoke certificates issued by the deactivated account, 1620 since this could cause operational disruption for servers using these 1621 certificates. ACME does not provide a way to reactivate a 1622 deactivated account. 1624 7.4. Applying for Certificate Issuance 1626 The client requests certificate issuance by sending a POST request to 1627 the server's new-order resource. The body of the POST is a JWS 1628 object whose JSON payload is a subset of the order object defined in 1629 Section 7.1.3, containing the fields that describe the certificate to 1630 be issued: 1632 identifiers (required, array of object): An array of identifier 1633 objects that the client wishes to submit an order for. 1635 type (required, string): The type of identifier. 1637 value (required, string): The identifier itself. 1639 notBefore (optional, string): The requested value of the notBefore 1640 field in the certificate, in the date format defined in [RFC3339] 1642 notAfter (optional, string): The requested value of the notAfter 1643 field in the certificate, in the date format defined in [RFC3339] 1645 POST /acme/new-order HTTP/1.1 1646 Host: example.com 1647 Content-Type: application/jose+json 1649 { 1650 "protected": base64url({ 1651 "alg": "ES256", 1652 "kid": "https://example.com/acme/acct/1", 1653 "nonce": "5XJ1L3lEkMG7tR6pA00clA", 1654 "url": "https://example.com/acme/new-order" 1655 }), 1656 "payload": base64url({ 1657 "identifiers": [{"type:"dns","value":"example.com"}], 1658 "notBefore": "2016-01-01T00:00:00Z", 1659 "notAfter": "2016-01-08T00:00:00Z" 1660 }), 1661 "signature": "H6ZXtGjTZyUnPeKn...wEA4TklBdh3e454g" 1662 } 1664 The server MUST return an error if it cannot fulfill the request as 1665 specified, and MUST NOT issue a certificate with contents other than 1666 those requested. If the server requires the request to be modified 1667 in a certain way, it should indicate the required changes using an 1668 appropriate error type and description. 1670 If the server is willing to issue the requested certificate, it 1671 responds with a 201 (Created) response. The body of this response is 1672 an order object reflecting the client's request and any 1673 authorizations the client must complete before the certificate will 1674 be issued. 1676 HTTP/1.1 201 Created 1677 Replay-Nonce: MYAuvOpaoIiywTezizk5vw 1678 Location: https://example.com/acme/order/asdf 1680 { 1681 "status": "pending", 1682 "expires": "2016-01-01T00:00:00Z", 1684 "notBefore": "2016-01-01T00:00:00Z", 1685 "notAfter": "2016-01-08T00:00:00Z", 1687 "identifiers": [ 1688 { "type:"dns", "value":"example.com" }, 1689 { "type:"dns", "value":"www.example.com" } 1690 ], 1692 "authorizations": [ 1693 "https://example.com/acme/authz/1234", 1694 "https://example.com/acme/authz/2345" 1695 ], 1697 "finalize": "https://example.com/acme/order/asdf/finalize" 1698 } 1700 The order object returned by the server represents a promise that if 1701 the client fulfills the server's requirements before the "expires" 1702 time, then the server will be willing to finalize the order upon 1703 request and issue the requested certificate. In the order object, 1704 any authorization referenced in the "authorizations" array whose 1705 status is "pending" represents an authorization transaction that the 1706 client must complete before the server will issue the certificate 1707 (see Section 7.5). If the client fails to complete the required 1708 actions before the "expires" time, then the server SHOULD change the 1709 status of the order to "invalid" and MAY delete the order resource. 1711 Once the client believes it has fulfilled the server's requirements, 1712 it should send a POST request to the order resource's finalize URL. 1713 The POST body MUST include a CSR: 1715 csr (required, string): A CSR encoding the parameters for the 1716 certificate being requested [RFC2986]. The CSR is sent in the 1717 base64url-encoded version of the DER format. (Note: Because this 1718 field uses base64url, and does not include headers, it is 1719 different from PEM.). 1721 POST /acme/order/asdf/finalize HTTP/1.1 1722 Host: example.com 1723 Content-Type: application/jose+json 1725 { 1726 "protected": base64url({ 1727 "alg": "ES256", 1728 "kid": "https://example.com/acme/acct/1", 1729 "nonce": "MSF2j2nawWHPxxkE3ZJtKQ", 1730 "url": "https://example.com/acme/order/asdf/finalize" 1731 }), 1732 "payload": base64url({ 1733 "csr": "5jNudRx6Ye4HzKEqT5...FS6aKdZeGsysoCo4H9P", 1734 }), 1735 "signature": "uOrUfIIk5RyQ...nw62Ay1cl6AB" 1736 } 1738 The CSR encodes the client's requests with regard to the content of 1739 the certificate to be issued. The CSR MUST indicate the exact same 1740 set of requested identifiers as the initial new-order request, either 1741 in the commonName portion of the requested subject name, or in an 1742 extensionRequest attribute [RFC2985] requesting a subjectAltName 1743 extension. 1745 A request to finalize an order will result in error if the order 1746 indicated does not have status "pending", if the CSR and order 1747 identifiers differ, or if the account is not authorized for the 1748 identifiers indicated in the CSR. 1750 A valid request to finalize an order will return the order to be 1751 finalized. The client should begin polling the order by sending a 1752 GET request to the order resource to obtain its current state. The 1753 status of the order will indicate what action the client should take: 1755 o "invalid": The certificate will not be issued. Consider this 1756 order process abandoned. 1758 o "pending": The server does not believe that the client has 1759 fulfilled the requirements. Check the "authorizations" array for 1760 entries that are still pending. 1762 o "processing": The server agrees that the requirements have been 1763 fulfilled, and is in the process of generating the certificate. 1764 Retry after the time given in the "Retry-After" header field of 1765 the response, if any. 1767 o "valid": The server has issued the certificate and provisioned its 1768 URL to the "certificate" field of the order. 1770 HTTP/1.1 200 Ok 1771 Replay-Nonce: CGf81JWBsq8QyIgPCi9Q9X 1772 Location: https://example.com/acme/order/asdf 1774 { 1775 "status": "valid", 1776 "expires": "2016-01-01T00:00:00Z", 1778 "notBefore": "2016-01-01T00:00:00Z", 1779 "notAfter": "2016-01-08T00:00:00Z", 1781 "identifiers": [ 1782 { "type:"dns", "value":"example.com" }, 1783 { "type:"dns", "value":"www.example.com" } 1784 ], 1786 "authorizations": [ 1787 "https://example.com/acme/authz/1234", 1788 "https://example.com/acme/authz/2345" 1789 ], 1791 "finalize": "https://example.com/acme/order/asdf/finalize", 1793 "certificate": "https://example.com/acme/cert/asdf" 1794 } 1796 7.4.1. Pre-Authorization 1798 The order process described above presumes that authorization objects 1799 are created reactively, in response to a certificate order. Some 1800 servers may also wish to enable clients to obtain authorization for 1801 an identifier proactively, outside of the context of a specific 1802 issuance. For example, a client hosting virtual servers for a 1803 collection of names might wish to obtain authorization before any 1804 virtual servers are created and only create a certificate when a 1805 virtual server starts up. 1807 In some cases, a CA running an ACME server might have a completely 1808 external, non-ACME process for authorizing a client to issue 1809 certificates for an identifier. In these cases, the CA should 1810 provision its ACME server with authorization objects corresponding to 1811 these authorizations and reflect them as already valid in any orders 1812 submitted by the client. 1814 If a CA wishes to allow pre-authorization within ACME, it can offer a 1815 "new authorization" resource in its directory by adding the field 1816 "newAuthz" with a URL for the new authorization resource. 1818 To request authorization for an identifier, the client sends a POST 1819 request to the new-authorization resource specifying the identifier 1820 for which authorization is being requested. 1822 identifier (required, object): The identifier that the account is 1823 authorized to represent: 1825 type (required, string): The type of identifier. 1827 value (required, string): The identifier itself. 1829 POST /acme/new-authz HTTP/1.1 1830 Host: example.com 1831 Content-Type: application/jose+json 1833 { 1834 "protected": base64url({ 1835 "alg": "ES256", 1836 "kid": "https://example.com/acme/acct/1", 1837 "nonce": "uQpSjlRb4vQVCjVYAyyUWg", 1838 "url": "https://example.com/acme/new-authz" 1839 }), 1840 "payload": base64url({ 1841 "identifier": { 1842 "type": "dns", 1843 "value": "example.net" 1844 } 1845 }), 1846 "signature": "nuSDISbWG8mMgE7H...QyVUL68yzf3Zawps" 1847 } 1849 Before processing the authorization request, the server SHOULD 1850 determine whether it is willing to issue certificates for the 1851 identifier. For example, the server should check that the identifier 1852 is of a supported type. Servers might also check names against a 1853 blacklist of known high-value identifiers. If the server is 1854 unwilling to issue for the identifier, it SHOULD return a 403 1855 (Forbidden) error, with a problem document describing the reason for 1856 the rejection. 1858 If the server is willing to proceed, it builds a pending 1859 authorization object from the inputs submitted by the client. 1861 o "identifier" the identifier submitted by the client 1863 o "status" MUST be "pending" unless the server has out-of-band 1864 information about the client's authorization status 1866 o "challenges" as selected by the server's policy for this 1867 identifier 1869 The server allocates a new URL for this authorization, and returns a 1870 201 (Created) response, with the authorization URL in the Location 1871 header field, and the JSON authorization object in the body. The 1872 client then follows the process described in Section 7.5 to complete 1873 the authorization process. 1875 7.4.2. Downloading the Certificate 1877 To download the issued certificate, the client simply sends a GET 1878 request to the certificate URL. 1880 The default format of the certificate is application/pem-certificate- 1881 chain (see IANA Considerations). 1883 The server MAY provide one or more link relation header fields 1884 [RFC5988] with relation "alternate". Each such field SHOULD express 1885 an alternative certificate chain starting with the same end-entity 1886 certificate. This can be used to express paths to various trust 1887 anchors. Clients can fetch these alternates and use their own 1888 heuristics to decide which is optimal. 1890 GET /acme/cert/asdf HTTP/1.1 1891 Host: example.com 1892 Accept: application/pkix-cert 1894 HTTP/1.1 200 OK 1895 Content-Type: application/pem-certificate-chain 1896 Link: ;rel="index" 1898 -----BEGIN CERTIFICATE----- 1899 [End-entity certificate contents] 1900 -----END CERTIFICATE----- 1901 -----BEGIN CERTIFICATE----- 1902 [Issuer certificate contents] 1903 -----END CERTIFICATE----- 1904 -----BEGIN CERTIFICATE----- 1905 [Other certificate contents] 1906 -----END CERTIFICATE----- 1908 A certificate resource represents a single, immutable certificate. 1909 If the client wishes to obtain a renewed certificate, the client 1910 initiates a new order process to request one. 1912 Because certificate resources are immutable once issuance is 1913 complete, the server MAY enable the caching of the resource by adding 1914 Expires and Cache-Control headers specifying a point in time in the 1915 distant future. These headers have no relation to the certificate's 1916 period of validity. 1918 The ACME client MAY request other formats by including an Accept 1919 header in its request. For example, the client could use the media 1920 type "application/pkix-cert" [RFC2585] to request the end-entity 1921 certificate in DER format. Server support for alternate formats is 1922 OPTIONAL. For formats that can only express a single certificate, 1923 the server SHOULD provide one or more "Link: rel="up"" headers 1924 pointing to an issuer or issuers so that ACME clients can build a 1925 certificate chain as defined in TLS. 1927 7.5. Identifier Authorization 1929 The identifier authorization process establishes the authorization of 1930 an account to manage certificates for a given identifier. This 1931 process assures the server of two things: 1933 1. That the client controls the private key of the account key pair, 1934 and 1936 2. That the client controls the identifier in question. 1938 This process may be repeated to associate multiple identifiers to a 1939 key pair (e.g., to request certificates with multiple identifiers), 1940 or to associate multiple accounts with an identifier (e.g., to allow 1941 multiple entities to manage certificates). 1943 Authorization resources are created by the server in response to 1944 certificate orders or authorization requests submitted by an account 1945 key holder; their URLs are provided to the client in the responses to 1946 these requests. The authorization object is implicitly tied to the 1947 account key used to sign the request. 1949 When a client receives an order from the server it downloads the 1950 authorization resources by sending GET requests to the indicated 1951 URLs. If the client initiates authorization using a request to the 1952 new authorization resource, it will have already received the pending 1953 authorization object in the response to that request. 1955 GET /acme/authz/1234 HTTP/1.1 1956 Host: example.com 1958 HTTP/1.1 200 OK 1959 Content-Type: application/json 1960 Link: ;rel="index" 1962 { 1963 "status": "pending", 1964 "expires": "2018-03-03T14:09:00Z", 1966 "identifier": { 1967 "type": "dns", 1968 "value": "example.org" 1969 }, 1971 "challenges": [ 1972 { 1973 "type": "http-01", 1974 "url": "https://example.com/acme/authz/1234/0", 1975 "token": "DGyRejmCefe7v4NfDGDKfA" 1976 }, 1977 { 1978 "type": "tls-sni-02", 1979 "url": "https://example.com/acme/authz/1234/1", 1980 "token": "DGyRejmCefe7v4NfDGDKfA" 1981 }, 1982 { 1983 "type": "dns-01", 1984 "url": "https://example.com/acme/authz/1234/2", 1985 "token": "DGyRejmCefe7v4NfDGDKfA" 1986 } 1987 ] 1988 } 1990 7.5.1. Responding to Challenges 1992 To prove control of the identifier and receive authorization, the 1993 client needs to respond with information to complete the challenges. 1994 To do this, the client updates the authorization object received from 1995 the server by filling in any required information in the elements of 1996 the "challenges" dictionary. 1998 The client sends these updates back to the server in the form of a 1999 JSON object with contents as specified by the challenge type, carried 2000 in a POST request to the challenge URL (not authorization URL) once 2001 it is ready for the server to attempt validation. 2003 For example, if the client were to respond to the "http-01" challenge 2004 in the above authorization, it would send the following request: 2006 POST /acme/authz/1234/0 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": "Q_s3MWoqT05TrdkM2MTDcw", 2015 "url": "https://example.com/acme/authz/1234/0" 2016 }), 2017 "payload": base64url({ 2018 "keyAuthorization": "IlirfxKKXA...vb29HhjjLPSggwiE" 2019 }), 2020 "signature": "9cbg5JO1Gf5YLjjz...SpkUfcdPai9uVYYQ" 2021 } 2023 The server updates the authorization document by updating its 2024 representation of the challenge with the response object provided by 2025 the client. The server MUST ignore any fields in the response object 2026 that are not specified as response fields for this type of challenge. 2027 The server provides a 200 (OK) response with the updated challenge 2028 object as its body. 2030 If the client's response is invalid for any reason or does not 2031 provide the server with appropriate information to validate the 2032 challenge, then the server MUST return an HTTP error. On receiving 2033 such an error, the client SHOULD undo any actions that have been 2034 taken to fulfill the challenge, e.g., removing files that have been 2035 provisioned to a web server. 2037 The server is said to "finalize" the authorization when it has 2038 completed one of the validations, by assigning the authorization a 2039 status of "valid" or "invalid", corresponding to whether it considers 2040 the account authorized for the identifier. If the final state is 2041 "valid", then the server MUST include an "expires" field. When 2042 finalizing an authorization, the server MAY remove challenges other 2043 than the one that was completed, and may modify the "expires" field. 2044 The server SHOULD NOT remove challenges with status "invalid". 2046 Usually, the validation process will take some time, so the client 2047 will need to poll the authorization resource to see when it is 2048 finalized. For challenges where the client can tell when the server 2049 has validated the challenge (e.g., by seeing an HTTP or DNS request 2050 from the server), the client SHOULD NOT begin polling until it has 2051 seen the validation request from the server. 2053 To check on the status of an authorization, the client sends a GET 2054 request to the authorization URL, and the server responds with the 2055 current authorization object. In responding to poll requests while 2056 the validation is still in progress, the server MUST return a 200 2057 (OK) response and MAY include a Retry-After header field to suggest a 2058 polling interval to the client. 2060 GET /acme/authz/1234 HTTP/1.1 2061 Host: example.com 2063 HTTP/1.1 200 OK 2065 { 2066 "status": "valid", 2067 "expires": "2018-09-09T14:09:00Z", 2069 "identifier": { 2070 "type": "dns", 2071 "value": "example.org" 2072 }, 2074 "challenges": [ 2075 { 2076 "type": "http-01" 2077 "url": "https://example.com/acme/authz/1234/0", 2078 "status": "valid", 2079 "validated": "2014-12-01T12:05:00Z", 2080 "token": "IlirfxKKXAsHtmzK29Pj8A", 2081 "keyAuthorization": "IlirfxKKXA...vb29HhjjLPSggwiE" 2082 } 2083 ] 2084 } 2086 7.5.2. Deactivating an Authorization 2088 If a client wishes to relinquish its authorization to issue 2089 certificates for an identifier, then it may request that the server 2090 deactivates each authorization associated with it by sending POST 2091 requests with the static object {"status": "deactivated"} to each 2092 authorization URL. 2094 POST /acme/authz/1234 HTTP/1.1 2095 Host: example.com 2096 Content-Type: application/jose+json 2098 { 2099 "protected": base64url({ 2100 "alg": "ES256", 2101 "kid": "https://example.com/acme/acct/1", 2102 "nonce": "xWCM9lGbIyCgue8di6ueWQ", 2103 "url": "https://example.com/acme/authz/1234" 2104 }), 2105 "payload": base64url({ 2106 "status": "deactivated" 2107 }), 2108 "signature": "srX9Ji7Le9bjszhu...WTFdtujObzMtZcx4" 2109 } 2111 The server MUST verify that the request is signed by the account key 2112 corresponding to the account that owns the authorization. If the 2113 server accepts the deactivation, it should reply with a 200 (OK) 2114 status code and the updated contents of the authorization object. 2116 The server MUST NOT treat deactivated authorization objects as 2117 sufficient for issuing certificates. 2119 7.6. Certificate Revocation 2121 To request that a certificate be revoked, the client sends a POST 2122 request to the ACME server's revoke-cert URL. The body of the POST 2123 is a JWS object whose JSON payload contains the certificate to be 2124 revoked: 2126 certificate (required, string): The certificate to be revoked, in 2127 the base64url-encoded version of the DER format. (Note: Because 2128 this field uses base64url, and does not include headers, it is 2129 different from PEM.) 2131 reason (optional, int): One of the revocation reasonCodes defined in 2132 Section 5.3.1 of [RFC5280] to be used when generating OCSP 2133 responses and CRLs. If this field is not set the server SHOULD 2134 use the unspecified (0) reasonCode value when generating OCSP 2135 responses and CRLs. The server MAY disallow a subset of 2136 reasonCodes from being used by the user. If a request contains a 2137 disallowed reasonCode the server MUST reject it with the error 2138 type "urn:ietf:params:acme:error:badRevocationReason". The 2139 problem document detail SHOULD indicate which reasonCodes are 2140 allowed. 2142 POST /acme/revoke-cert HTTP/1.1 2143 Host: example.com 2144 Content-Type: application/jose+json 2146 { 2147 "protected": base64url({ 2148 "alg": "ES256", 2149 "jwk": /* account key */, 2150 "nonce": "JHb54aT_KTXBWQOzGYkt9A", 2151 "url": "https://example.com/acme/revoke-cert" 2152 }), 2153 "payload": base64url({ 2154 "certificate": "MIIEDTCCAvegAwIBAgIRAP8...", 2155 "reason": 1 2156 }), 2157 "signature": "Q1bURgJoEslbD1c5...3pYdSMLio57mQNN4" 2158 } 2160 Revocation requests are different from other ACME requests in that 2161 they can be signed either with an account key pair or the key pair in 2162 the certificate. Before revoking a certificate, the server MUST 2163 verify that the key used to sign the request is authorized to revoke 2164 the certificate. The server MUST consider at least the following 2165 accounts authorized for a given certificate: 2167 o the account that issued the certificate. 2169 o an account that holds authorizations for all of the identifiers in 2170 the certificate. 2172 The server MUST also consider a revocation request valid if it is 2173 signed with the private key corresponding to the public key in the 2174 certificate. 2176 If the revocation succeeds, the server responds with status code 200 2177 (OK). If the revocation fails, the server returns an error. 2179 HTTP/1.1 200 OK 2180 Replay-Nonce: IXVHDyxIRGcTE0VSblhPzw 2181 Content-Length: 0 2183 --- or --- 2185 HTTP/1.1 403 Forbidden 2186 Replay-Nonce: IXVHDyxIRGcTE0VSblhPzw 2187 Content-Type: application/problem+json 2188 Content-Language: en 2190 { 2191 "type": "urn:ietf:params:acme:error:unauthorized", 2192 "detail": "No authorization provided for name example.net" 2193 } 2195 8. Identifier Validation Challenges 2197 There are few types of identifiers in the world for which there is a 2198 standardized mechanism to prove possession of a given identifier. In 2199 all practical cases, CAs rely on a variety of means to test whether 2200 an entity applying for a certificate with a given identifier actually 2201 controls that identifier. 2203 Challenges provide the server with assurance that an account holder 2204 is also the entity that controls an identifier. For each type of 2205 challenge, it must be the case that in order for an entity to 2206 successfully complete the challenge the entity must both: 2208 o Hold the private key of the account key pair used to respond to 2209 the challenge 2211 o Control the identifier in question 2213 Section 10 documents how the challenges defined in this document meet 2214 these requirements. New challenges will need to document how they 2215 do. 2217 ACME uses an extensible challenge/response framework for identifier 2218 validation. The server presents a set of challenges in the 2219 authorization object it sends to a client (as objects in the 2220 "challenges" array), and the client responds by sending a response 2221 object in a POST request to a challenge URL. 2223 This section describes an initial set of challenge types. The 2224 definition of a challenge type includes: 2226 1. Content of challenge objects 2227 2. Content of response objects 2229 3. How the server uses the challenge and response to verify control 2230 of an identifier 2232 Challenge objects all contain the following basic fields: 2234 type (required, string): The type of challenge encoded in the 2235 object. 2237 url (required, string): The URL to which a response can be posted. 2239 status (required, string): The status of this challenge. Possible 2240 values are: "pending", "valid", and "invalid". 2242 validated (optional, string): The time at which the server validated 2243 this challenge, encoded in the format specified in RFC 3339 2244 [RFC3339]. This field is REQUIRED if the "status" field is 2245 "valid". 2247 errors (optional, array of object): Errors that occurred while the 2248 server was validating the challenge, if any, structured as problem 2249 documents [RFC7807]. The server MUST NOT modify the array except 2250 by appending entries onto the end. The server can limit the size 2251 of this object by limiting the number of times it will try to 2252 validate a challenge. 2254 All additional fields are specified by the challenge type. If the 2255 server sets a challenge's "status" to "invalid", it SHOULD also 2256 include the "errors" field to help the client diagnose why the 2257 challenge failed. 2259 Different challenges allow the server to obtain proof of different 2260 aspects of control over an identifier. In some challenges, like 2261 HTTP, TLS SNI, and DNS, the client directly proves its ability to do 2262 certain things related to the identifier. The choice of which 2263 challenges to offer to a client under which circumstances is a matter 2264 of server policy. 2266 The identifier validation challenges described in this section all 2267 relate to validation of domain names. If ACME is extended in the 2268 future to support other types of identifiers, there will need to be 2269 new challenge types, and they will need to specify which types of 2270 identifier they apply to. 2272 8.1. Key Authorizations 2274 Several of the challenges in this document make use of a key 2275 authorization string. A key authorization is a string that expresses 2276 a domain holder's authorization for a specified key to satisfy a 2277 specified challenge, by concatenating the token for the challenge 2278 with a key fingerprint, separated by a "." character: 2280 key-authz = token || '.' || base64url(JWK_Thumbprint(accountKey)) 2282 The "JWK_Thumbprint" step indicates the computation specified in 2283 [RFC7638], using the SHA-256 digest [FIPS180-4]. As noted in JWA 2284 [RFC7518] any prepended zero octets in the fields of a JWK object 2285 MUST be stripped before doing the computation. 2287 As specified in the individual challenges below, the token for a 2288 challenge is a string comprised entirely of characters in the URL- 2289 safe base64 alphabet. The "||" operator indicates concatenation of 2290 strings. 2292 8.2. Retrying Challenges 2294 ACME challenges typically require the client to set up some network- 2295 accessible resource that the server can query in order to validate 2296 that the client controls an identifier. In practice it is not 2297 uncommon for the server's queries to fail while a resource is being 2298 set up, e.g., due to information propagating across a cluster or 2299 firewall rules not being in place. 2301 Clients SHOULD NOT respond to challenges until they believe that the 2302 server's queries will succeed. If a server's initial validation 2303 query fails, the server SHOULD retry the query after some time, in 2304 order to account for delay in setting up responses such as DNS 2305 records or HTTP resources. The precise retry schedule is up to the 2306 server, but server operators should keep in mind the operational 2307 scenarios that the schedule is trying to accommodate. Given that 2308 retries are intended to address things like propagation delays in 2309 HTTP or DNS provisioning, there should not usually be any reason to 2310 retry more often than every 5 or 10 seconds. While the server is 2311 still trying, the status of the challenge remains "pending"; it is 2312 only marked "invalid" once the server has given up. 2314 The server MUST provide information about its retry state to the 2315 client via the "errors" field in the challenge and the Retry-After 2316 HTTP header field in response to requests to the challenge resource. 2317 The server MUST add an entry to the "errors" field in the challenge 2318 after each failed validation query. The server SHOULD set the Retry- 2319 After header field to a time after the server's next validation 2320 query, since the status of the challenge will not change until that 2321 time. 2323 Clients can explicitly request a retry by re-sending their response 2324 to a challenge in a new POST request (with a new nonce, etc.). This 2325 allows clients to request a retry when the state has changed (e.g., 2326 after firewall rules have been updated). Servers SHOULD retry a 2327 request immediately on receiving such a POST request. In order to 2328 avoid denial-of-service attacks via client-initiated retries, servers 2329 SHOULD rate-limit such requests. 2331 8.3. HTTP Challenge 2333 With HTTP validation, the client in an ACME transaction proves its 2334 control over a domain name by proving that it can provision HTTP 2335 resources on a server accessible under that domain name. The ACME 2336 server challenges the client to provision a file at a specific path, 2337 with a specific string as its content. 2339 As a domain may resolve to multiple IPv4 and IPv6 addresses, the 2340 server will connect to at least one of the hosts found in the DNS A 2341 and AAAA records, at its discretion. Because many web servers 2342 allocate a default HTTPS virtual host to a particular low-privilege 2343 tenant user in a subtle and non-intuitive manner, the challenge must 2344 be completed over HTTP, not HTTPS. 2346 type (required, string): The string "http-01" 2348 token (required, string): A random value that uniquely identifies 2349 the challenge. This value MUST have at least 128 bits of entropy. 2350 It MUST NOT contain any characters outside the base64url alphabet, 2351 and MUST NOT include base64 padding characters ("="). 2353 GET /acme/authz/1234/0 HTTP/1.1 2354 Host: example.com 2356 HTTP/1.1 200 OK 2357 { 2358 "type": "http-01", 2359 "url": "https://example.com/acme/authz/0", 2360 "status": "pending", 2361 "token": "LoqXcYV8q5ONbJQxbmR7SCTNo3tiAXDfowyjxAjEuX0" 2362 } 2364 A client responds to this challenge by constructing a key 2365 authorization from the "token" value provided in the challenge and 2366 the client's account key. The client then provisions the key 2367 authorization as a resource on the HTTP server for the domain in 2368 question. 2370 The path at which the resource is provisioned is comprised of the 2371 fixed prefix "/.well-known/acme-challenge/", followed by the "token" 2372 value in the challenge. The value of the resource MUST be the ASCII 2373 representation of the key authorization. 2375 GET /.well-known/acme-challenge/LoqXcYV8q5ONbJQxbmR7SCTNo3tiAXDfowyjxAjEuX0 2376 Host: example.org 2378 HTTP/1.1 200 OK 2379 LoqXcYV8q5ONbJQxbmR7SCTNo3tiAXDfowyjxAjEuX0.9jg46WB3rR_AHD-EBXdN7cBkH1WOu0tA3M9fm21mqTI 2381 The client's response to the validation request indicates its 2382 agreement to this challenge by sending the server the key 2383 authorization covering the challenge's token and the client's account 2384 key. 2386 keyAuthorization (required, string): The key authorization for this 2387 challenge. This value MUST match the token from the challenge and 2388 the client's account key. 2390 POST /acme/authz/1234/0 2391 Host: example.com 2392 Content-Type: application/jose+json 2394 { 2395 "protected": base64url({ 2396 "alg": "ES256", 2397 "kid": "https://example.com/acme/acct/1", 2398 "nonce": "JHb54aT_KTXBWQOzGYkt9A", 2399 "url": "https://example.com/acme/authz/1234/0" 2400 }), 2401 "payload": base64url({ 2402 "keyAuthorization": "evaGxfADs...62jcerQ" 2403 }), 2404 "signature": "Q1bURgJoEslbD1c5...3pYdSMLio57mQNN4" 2405 } 2407 On receiving a response, the server MUST verify that the key 2408 authorization in the response matches the "token" value in the 2409 challenge and the client's account key. If they do not match, then 2410 the server MUST return an HTTP error in response to the POST request 2411 in which the client sent the challenge. 2413 Given a challenge/response pair, the server verifies the client's 2414 control of the domain by verifying that the resource was provisioned 2415 as expected. 2417 1. Construct a URL by populating the URL template [RFC6570] 2418 "http://{domain}/.well-known/acme-challenge/{token}", where: 2420 * the domain field is set to the domain name being verified; and 2422 * the token field is set to the token in the challenge. 2424 2. Verify that the resulting URL is well-formed. 2426 3. Dereference the URL using an HTTP GET request. This request MUST 2427 be sent to TCP port 80 on the HTTP server. 2429 4. Verify that the body of the response is well-formed key 2430 authorization. The server SHOULD ignore whitespace characters at 2431 the end of the body. 2433 5. Verify that key authorization provided by the HTTP server matches 2434 the key authorization provided by the client in its response to 2435 the challenge. 2437 The server SHOULD follow redirects when dereferencing the URL. 2439 If all of the above verifications succeed, then the validation is 2440 successful. If the request fails, or the body does not pass these 2441 checks, then it has failed. 2443 8.4. TLS with Server Name Indication (TLS SNI) Challenge 2445 The TLS with Server Name Indication (TLS SNI) validation method 2446 proves control over a domain name by requiring the client to 2447 configure a TLS server referenced by the DNS A and AAAA resource 2448 records for the domain name to respond to specific connection 2449 attempts utilizing the Server Name Indication extension [RFC6066]. 2450 The server verifies the client's challenge by accessing the TLS 2451 server and verifying a particular certificate is presented. 2453 type (required, string): The string "tls-sni-02" 2455 token (required, string): A random value that uniquely identifies 2456 the challenge. This value MUST have at least 128 bits of entropy. 2457 It MUST NOT contain any characters outside the base64url alphabet, 2458 including padding characters ("="). 2460 GET /acme/authz/1234/1 HTTP/1.1 2461 Host: example.com 2463 HTTP/1.1 200 OK 2464 { 2465 "type": "tls-sni-02", 2466 "url": "https://example.com/acme/authz/1234/1", 2467 "status": "pending", 2468 "token": "evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA" 2469 } 2471 A client responds to this challenge by constructing a self-signed 2472 certificate which the client MUST provision at the domain name 2473 concerned in order to pass the challenge. 2475 The certificate may be constructed arbitrarily, except that each 2476 certificate MUST have exactly two subjectAlternativeNames, SAN A and 2477 SAN B. Both MUST be dNSNames [RFC5280]. 2479 SAN A MUST be constructed as follows: compute the SHA-256 digest 2480 [FIPS180-4] of the challenge token and encode it in lowercase 2481 hexadecimal form. The dNSName is "x.y.token.acme.invalid", where x 2482 is the first half of the hexadecimal representation and y is the 2483 second half. 2485 SAN B MUST be constructed as follows: compute the SHA-256 digest of 2486 the key authorization and encode it in lowercase hexadecimal form. 2487 The dNSName is "x.y.ka.acme.invalid" where x is the first half of the 2488 hexadecimal representation and y is the second half. 2490 The client MUST ensure that the certificate is served to TLS 2491 connections specifying a Server Name Indication (SNI) value of SAN A. 2493 The response to the TLS-SNI challenge simply acknowledges that the 2494 client is ready to fulfill this challenge. 2496 keyAuthorization (required, string): The key authorization for this 2497 challenge. This value MUST match the token from the challenge and 2498 the client's account key. 2500 POST /acme/authz/1234/1 2501 Host: example.com 2502 Content-Type: application/jose+json 2504 { 2505 "protected": base64url({ 2506 "alg": "ES256", 2507 "kid": "https://example.com/acme/acct/1", 2508 "nonce": "JHb54aT_KTXBWQOzGYkt9A", 2509 "url": "https://example.com/acme/authz/1234/1" 2510 }), 2511 "payload": base64url({ 2512 "keyAuthorization": "evaGxfADs...62jcerQ" 2513 }), 2514 "signature": "Q1bURgJoEslbD1c5...3pYdSMLio57mQNN4" 2515 } 2517 On receiving a response, the server MUST verify that the key 2518 authorization in the response matches the "token" value in the 2519 challenge and the client's account key. If they do not match, then 2520 the server MUST return an HTTP error in response to the POST request 2521 in which the client sent the challenge. 2523 Given a challenge/response pair, the ACME server verifies the 2524 client's control of the domain by verifying that the TLS server was 2525 configured appropriately, using these steps: 2527 1. Compute SAN A and SAN B in the same way as the client. 2529 2. Open a TLS connection to the domain name being validated, 2530 presenting SAN A in the SNI field. This connection MUST be sent 2531 to TCP port 443 on the TLS server. In the ClientHello initiating 2532 the TLS handshake, the server MUST include a server_name 2533 extension (i.e., SNI) containing SAN A. The server SHOULD ensure 2534 that it does not reveal SAN B in any way when making the TLS 2535 connection, such that the presentation of SAN B in the returned 2536 certificate proves association with the client. 2538 3. Verify that the certificate contains a subjectAltName extension 2539 containing dNSName entries of SAN A and SAN B and no other 2540 entries. The comparison MUST be insensitive to case and ordering 2541 of names. 2543 If all of the above verifications succeed, then the validation is 2544 successful. Otherwise, the validation fails. 2546 8.5. DNS Challenge 2548 When the identifier being validated is a domain name, the client can 2549 prove control of that domain by provisioning a TXT resource record 2550 containing a designated value for a specific validation domain name. 2552 type (required, string): The string "dns-01" 2554 token (required, string): A random value that uniquely identifies 2555 the challenge. This value MUST have at least 128 bits of entropy. 2556 It MUST NOT contain any characters outside the base64url alphabet, 2557 including padding characters ("="). 2559 GET /acme/authz/1234/2 HTTP/1.1 2560 Host: example.com 2562 HTTP/1.1 200 OK 2563 { 2564 "type": "dns-01", 2565 "url": "https://example.com/acme/authz/1234/2", 2566 "status": "pending", 2567 "token": "evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA" 2568 } 2570 A client responds to this challenge by constructing a key 2571 authorization from the "token" value provided in the challenge and 2572 the client's account key. The client then computes the SHA-256 2573 digest [FIPS180-4] of the key authorization. 2575 The record provisioned to the DNS contains the base64url encoding of 2576 this digest. The client constructs the validation domain name by 2577 prepending the label "_acme-challenge" to the domain name being 2578 validated, then provisions a TXT record with the digest value under 2579 that name. For example, if the domain name being validated is 2580 "example.org", then the client would provision the following DNS 2581 record: 2583 _acme-challenge.example.org. 300 IN TXT "gfj9Xq...Rg85nM" 2585 The response to the DNS challenge provides the computed key 2586 authorization to acknowledge that the client is ready to fulfill this 2587 challenge. 2589 keyAuthorization (required, string): The key authorization for this 2590 challenge. This value MUST match the token from the challenge and 2591 the client's account key. 2593 POST /acme/authz/1234/2 2594 Host: example.com 2595 Content-Type: application/jose+json 2597 { 2598 "protected": base64url({ 2599 "alg": "ES256", 2600 "kid": "https://example.com/acme/acct/1", 2601 "nonce": "JHb54aT_KTXBWQOzGYkt9A", 2602 "url": "https://example.com/acme/authz/1234/2" 2603 }), 2604 "payload": base64url({ 2605 "keyAuthorization": "evaGxfADs...62jcerQ" 2606 }), 2607 "signature": "Q1bURgJoEslbD1c5...3pYdSMLio57mQNN4" 2608 } 2610 On receiving a response, the server MUST verify that the key 2611 authorization in the response matches the "token" value in the 2612 challenge and the client's account key. If they do not match, then 2613 the server MUST return an HTTP error in response to the POST request 2614 in which the client sent the challenge. 2616 To validate a DNS challenge, the server performs the following steps: 2618 1. Compute the SHA-256 digest [FIPS180-4] of the key authorization 2620 2. Query for TXT records for the validation domain name 2622 3. Verify that the contents of one of the TXT records match the 2623 digest value 2625 If all of the above verifications succeed, then the validation is 2626 successful. If no DNS record is found, or DNS record and response 2627 payload do not pass these checks, then the validation fails. 2629 9. IANA Considerations 2631 9.1. MIME Type: application/pem-certificate-chain 2633 The "Media Types" registry should be updated with the following 2634 additional value: 2636 MIME media type name: application 2638 MIME subtype name: pem-certificate-chain 2640 Required parameters: None 2641 Optional parameters: None 2643 Encoding considerations: None 2645 Security considerations: Carries a cryptographic certificate and its 2646 associated certificate chain 2648 Interoperability considerations: None 2650 Published specification: draft-ietf-acme-acme [[ RFC EDITOR: Please 2651 replace draft-ietf-acme-acme above with the RFC number assigned to 2652 this ]] 2654 Applications which use this media type: Any MIME-compliant transport 2656 Additional information: 2658 File contains one or more certificates encoded with the PEM textual 2659 encoding, according to RFC 7468 [RFC7468]. In order to provide easy 2660 interoperation with TLS, the first certificate MUST be an end-entity 2661 certificate. Each following certificate SHOULD directly certify one 2662 preceding it. Because certificate validation requires that trust 2663 anchors be distributed independently, a certificate that specifies a 2664 trust anchor MAY be omitted from the chain, provided that supported 2665 peers are known to possess any omitted certificates. 2667 9.2. Well-Known URI for the HTTP Challenge 2669 The "Well-Known URIs" registry should be updated with the following 2670 additional value (using the template from [RFC5785]): 2672 URI suffix: acme-challenge 2674 Change controller: IETF 2676 Specification document(s): This document, Section Section 8.3 2678 Related information: N/A 2680 9.3. Replay-Nonce HTTP Header 2682 The "Message Headers" registry should be updated with the following 2683 additional value: 2685 +-------------------+----------+----------+---------------+ 2686 | Header Field Name | Protocol | Status | Reference | 2687 +-------------------+----------+----------+---------------+ 2688 | Replay-Nonce | http | standard | Section 6.4.1 | 2689 +-------------------+----------+----------+---------------+ 2691 9.4. "url" JWS Header Parameter 2693 The "JSON Web Signature and Encryption Header Parameters" registry 2694 should be updated with the following additional value: 2696 o Header Parameter Name: "url" 2698 o Header Parameter Description: URL 2700 o Header Parameter Usage Location(s): JWE, JWS 2702 o Change Controller: IESG 2704 o Specification Document(s): Section 6.3.1 of RFC XXXX 2706 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2707 to this document ]] 2709 9.5. "nonce" JWS Header Parameter 2711 The "JSON Web Signature and Encryption Header Parameters" registry 2712 should be updated with the following additional value: 2714 o Header Parameter Name: "nonce" 2716 o Header Parameter Description: Nonce 2718 o Header Parameter Usage Location(s): JWE, JWS 2720 o Change Controller: IESG 2722 o Specification Document(s): Section 6.4.2 of RFC XXXX 2724 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2725 to this document ]] 2727 9.6. URN Sub-namespace for ACME (urn:ietf:params:acme) 2729 The "IETF URN Sub-namespace for Registered Protocol Parameter 2730 Identifiers" registry should be updated with the following additional 2731 value, following the template in [RFC3553]: 2733 Registry name: acme 2735 Specification: RFC XXXX 2737 Repository: URL-TBD 2739 Index value: No transformation needed. 2741 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2742 to this document, and replace URL-TBD with the URL assigned by IANA 2743 for registries of ACME parameters. ]] 2745 9.7. New Registries 2747 This document requests that IANA create the following new registries: 2749 1. ACME Account Object Fields (Section 9.7.1) 2751 2. ACME Order Object Fields (Section 9.7.2) 2753 3. ACME Error Types (Section 9.7.4) 2755 4. ACME Resource Types (Section 9.7.5) 2757 5. ACME Directory Metadata Fields (Section 9.7.6) 2759 6. ACME Identifier Types (Section 9.7.7) 2761 7. ACME Validation Methods (Section 9.7.8) 2763 All of these registries are under a heading of "Automated Certificate 2764 Management Environment (ACME) Protocol" and are administered under a 2765 Specification Required policy [RFC8126]. 2767 9.7.1. Fields in Account Objects 2769 This registry lists field names that are defined for use in ACME 2770 account objects. Fields marked as "configurable" may be included in 2771 a new-account request. 2773 Template: 2775 o Field name: The string to be used as a field name in the JSON 2776 object 2778 o Field type: The type of value to be provided, e.g., string, 2779 boolean, array of string 2781 o Client configurable: Boolean indicating whether the server should 2782 accept values provided by the client 2784 o Reference: Where this field is defined 2786 Initial contents: The fields and descriptions defined in 2787 Section 7.1.2. 2789 +------------------------+---------------+--------------+-----------+ 2790 | Field Name | Field Type | Configurable | Reference | 2791 +------------------------+---------------+--------------+-----------+ 2792 | status | string | false | RFC XXXX | 2793 | | | | | 2794 | contact | array of | true | RFC XXXX | 2795 | | string | | | 2796 | | | | | 2797 | externalAccountBinding | object | true | RFC XXXX | 2798 | | | | | 2799 | termsOfServiceAgreed | boolean | true | RFC XXXX | 2800 | | | | | 2801 | orders | array of | false | RFC XXXX | 2802 | | string | | | 2803 +------------------------+---------------+--------------+-----------+ 2805 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2806 to this document ]] 2808 9.7.2. Fields in Order Objects 2810 This registry lists field names that are defined for use in ACME 2811 order objects. Fields marked as "configurable" may be included in a 2812 new-order request. 2814 Template: 2816 o Field name: The string to be used as a field name in the JSON 2817 object 2819 o Field type: The type of value to be provided, e.g., string, 2820 boolean, array of string 2822 o Client configurable: Boolean indicating whether the server should 2823 accept values provided by the client 2825 o Reference: Where this field is defined 2827 Initial contents: The fields and descriptions defined in 2828 Section 7.1.3. 2830 +----------------+-----------------+--------------+-----------+ 2831 | Field Name | Field Type | Configurable | Reference | 2832 +----------------+-----------------+--------------+-----------+ 2833 | status | string | false | RFC XXXX | 2834 | | | | | 2835 | expires | string | false | RFC XXXX | 2836 | | | | | 2837 | identifiers | array of object | true | RFC XXXX | 2838 | | | | | 2839 | notBefore | string | true | RFC XXXX | 2840 | | | | | 2841 | notAfter | string | true | RFC XXXX | 2842 | | | | | 2843 | authorizations | array of string | false | RFC XXXX | 2844 | | | | | 2845 | finalize | string | false | RFC XXXX | 2846 | | | | | 2847 | certificate | string | false | RFC XXXX | 2848 +----------------+-----------------+--------------+-----------+ 2850 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2851 to this document ]] 2853 9.7.3. Fields in Authorization Objects 2855 This registry lists field names that are defined for use in ACME 2856 authorization objects. Fields marked as "configurable" may be 2857 included in a new-authorization request. 2859 Template: 2861 o Field name: The string to be used as a field name in the JSON 2862 object 2864 o Field type: The type of value to be provided, e.g., string, 2865 boolean, array of string 2867 o Client configurable: Boolean indicating whether the server should 2868 accept values provided by the client 2870 o Reference: Where this field is defined 2872 Initial contents: The fields and descriptions defined in 2873 Section 7.1.4. 2875 +------------+-----------------+--------------+-----------+ 2876 | Field Name | Field Type | Configurable | Reference | 2877 +------------+-----------------+--------------+-----------+ 2878 | identifier | object | true | RFC XXXX | 2879 | | | | | 2880 | status | string | false | RFC XXXX | 2881 | | | | | 2882 | expires | string | false | RFC XXXX | 2883 | | | | | 2884 | challenges | array of object | false | RFC XXXX | 2885 +------------+-----------------+--------------+-----------+ 2887 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2888 to this document ]] 2890 9.7.4. Error Types 2892 This registry lists values that are used within URN values that are 2893 provided in the "type" field of problem documents in ACME. 2895 Template: 2897 o Type: The label to be included in the URN for this error, 2898 following "urn:ietf:params:acme:error:" 2900 o Description: A human-readable description of the error 2902 o Reference: Where the error is defined 2904 Initial contents: The types and descriptions in the table in 2905 Section 6.6 above, with the Reference field set to point to this 2906 specification. 2908 9.7.5. Resource Types 2910 This registry lists the types of resources that ACME servers may list 2911 in their directory objects. 2913 Template: 2915 o Field name: The value to be used as a field name in the directory 2916 object 2918 o Resource type: The type of resource labeled by the field 2920 o Reference: Where the resource type is defined 2922 Initial contents: 2924 +------------+--------------------+-----------+ 2925 | Field Name | Resource Type | Reference | 2926 +------------+--------------------+-----------+ 2927 | newNonce | New nonce | RFC XXXX | 2928 | | | | 2929 | newAccount | New account | RFC XXXX | 2930 | | | | 2931 | newOrder | New order | RFC XXXX | 2932 | | | | 2933 | newAuthz | New authorization | RFC XXXX | 2934 | | | | 2935 | revokeCert | Revoke certificate | RFC XXXX | 2936 | | | | 2937 | keyChange | Key change | RFC XXXX | 2938 | | | | 2939 | meta | Metadata object | RFC XXXX | 2940 +------------+--------------------+-----------+ 2942 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2943 to this document ]] 2945 9.7.6. Fields in the "meta" Object within a Directory Object 2947 This registry lists field names that are defined for use in the JSON 2948 object included in the "meta" field of an ACME directory object. 2950 Template: 2952 o Field name: The string to be used as a field name in the JSON 2953 object 2955 o Field type: The type of value to be provided, e.g., string, 2956 boolean, array of string 2958 o Reference: Where this field is defined 2960 Initial contents: The fields and descriptions defined in 2961 Section 7.1.2. 2963 +-------------------------+-----------------+-----------+ 2964 | Field Name | Field Type | Reference | 2965 +-------------------------+-----------------+-----------+ 2966 | termsOfService | string | RFC XXXX | 2967 | | | | 2968 | website | string | RFC XXXX | 2969 | | | | 2970 | caaIdentities | array of string | RFC XXXX | 2971 | | | | 2972 | externalAccountRequired | boolean | RFC XXXX | 2973 +-------------------------+-----------------+-----------+ 2975 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2976 to this document ]] 2978 9.7.7. Identifier Types 2980 This registry lists the types of identifiers that can be present in 2981 ACME authorization objects. 2983 Template: 2985 o Label: The value to be put in the "type" field of the identifier 2986 object 2988 o Reference: Where the identifier type is defined 2990 Initial contents: 2992 +-------+-----------+ 2993 | Label | Reference | 2994 +-------+-----------+ 2995 | dns | RFC XXXX | 2996 +-------+-----------+ 2998 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2999 to this document ]] 3001 9.7.8. Validation Methods 3003 This registry lists identifiers for the ways that CAs can validate 3004 control of identifiers. Each method's entry must specify whether it 3005 corresponds to an ACME challenge type. The "Identifier Type" field 3006 must be contained in the Label column of the ACME Identifier Types 3007 registry. 3009 Template: 3011 o Label: The identifier for this validation method 3013 o Identifier Type: The type of identifier that this method applies 3014 to 3016 o ACME: "Y" if the validation method corresponds to an ACME 3017 challenge type; "N" otherwise. 3019 o Reference: Where the validation method is defined 3021 Initial Contents 3023 +------------+-----------------+------+-----------+ 3024 | Label | Identifier Type | ACME | Reference | 3025 +------------+-----------------+------+-----------+ 3026 | http-01 | dns | Y | RFC XXXX | 3027 | | | | | 3028 | tls-sni-02 | dns | Y | RFC XXXX | 3029 | | | | | 3030 | dns-01 | dns | Y | RFC XXXX | 3031 +------------+-----------------+------+-----------+ 3033 When evaluating a request for an assignment in this registry, the 3034 designated expert should ensure that the method being registered has 3035 a clear, interoperable definition and does not overlap with existing 3036 validation methods. That is, it should not be possible for a client 3037 and server to follow take the same set of actions to fulfill two 3038 different validation mechanisms. 3040 Validation methods do not have to be compatible with ACME in order to 3041 be registered. For example, a CA might wish to register a validation 3042 method in order to support its use with the ACME extensions to CAA 3043 [I-D.ietf-acme-caa]. 3045 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 3046 to this document ]] 3048 10. Security Considerations 3050 ACME is a protocol for managing certificates that attest to 3051 identifier/key bindings. Thus the foremost security goal of ACME is 3052 to ensure the integrity of this process, i.e., to ensure that the 3053 bindings attested by certificates are correct and that only 3054 authorized entities can manage certificates. ACME identifies clients 3055 by their account keys, so this overall goal breaks down into two more 3056 precise goals: 3058 1. Only an entity that controls an identifier can get an 3059 authorization for that identifier 3061 2. Once authorized, an account key's authorizations cannot be 3062 improperly used by another account 3064 In this section, we discuss the threat model that underlies ACME and 3065 the ways that ACME achieves these security goals within that threat 3066 model. We also discuss the denial-of-service risks that ACME servers 3067 face, and a few other miscellaneous considerations. 3069 10.1. Threat Model 3071 As a service on the Internet, ACME broadly exists within the Internet 3072 threat model [RFC3552]. In analyzing ACME, it is useful to think of 3073 an ACME server interacting with other Internet hosts along two 3074 "channels": 3076 o An ACME channel, over which the ACME HTTPS requests are exchanged 3078 o A validation channel, over which the ACME server performs 3079 additional requests to validate a client's control of an 3080 identifier 3082 +------------+ 3083 | ACME | ACME Channel 3084 | Client |--------------------+ 3085 +------------+ | 3086 V 3087 +------------+ 3088 | ACME | 3089 | Server | 3090 +------------+ 3091 +------------+ | 3092 | Validation |<-------------------+ 3093 | Server | Validation Channel 3094 +------------+ 3096 In practice, the risks to these channels are not entirely separate, 3097 but they are different in most cases. Each channel, for example, 3098 uses a different communications pattern: the ACME channel will 3099 comprise inbound HTTPS connections to the ACME server and the 3100 validation channel outbound HTTP or DNS requests. 3102 Broadly speaking, ACME aims to be secure against active and passive 3103 attackers on any individual channel. Some vulnerabilities arise 3104 (noted below) when an attacker can exploit both the ACME channel and 3105 one of the others. 3107 On the ACME channel, in addition to network layer attackers, we also 3108 need to account for man-in-the-middle (MitM) attacks at the 3109 application layer, and for abusive use of the protocol itself. 3110 Protection against application layer MitM addresses potential 3111 attackers such as Content Distribution Networks (CDNs) and 3112 middleboxes with a TLS MitM function. Preventing abusive use of ACME 3113 means ensuring that an attacker with access to the validation channel 3114 can't obtain illegitimate authorization by acting as an ACME client 3115 (legitimately, in terms of the protocol). 3117 10.2. Integrity of Authorizations 3119 ACME allows anyone to request challenges for an identifier by 3120 registering an account key and sending a new-order request using that 3121 account key. The integrity of the authorization process thus depends 3122 on the identifier validation challenges to ensure that the challenge 3123 can only be completed by someone who both (1) holds the private key 3124 of the account key pair, and (2) controls the identifier in question. 3126 Validation responses need to be bound to an account key pair in order 3127 to avoid situations where an ACME MitM can switch out a legitimate 3128 domain holder's account key for one of his choosing, e.g.: 3130 o Legitimate domain holder registers account key pair A 3132 o MitM registers account key pair B 3134 o Legitimate domain holder sends a new-order request signed using 3135 account key A 3137 o MitM suppresses the legitimate request but sends the same request 3138 signed using account key B 3140 o ACME server issues challenges and MitM forwards them to the 3141 legitimate domain holder 3143 o Legitimate domain holder provisions the validation response 3145 o ACME server performs validation query and sees the response 3146 provisioned by the legitimate domain holder 3148 o Because the challenges were issued in response to a message signed 3149 account key B, the ACME server grants authorization to account key 3150 B (the MitM) instead of account key A (the legitimate domain 3151 holder) 3153 All of the challenges above have a binding between the account 3154 private key and the validation query made by the server, via the key 3155 authorization. The key authorization reflects the account public 3156 key, is provided to the server in the validation response over the 3157 validation channel and signed afterwards by the corresponding private 3158 key in the challenge response over the ACME channel. 3160 The association of challenges to identifiers is typically done by 3161 requiring the client to perform some action that only someone who 3162 effectively controls the identifier can perform. For the challenges 3163 in this document, the actions are: 3165 o HTTP: Provision files under .well-known on a web server for the 3166 domain 3168 o TLS SNI: Configure a TLS server for the domain 3170 o DNS: Provision DNS resource records for the domain 3172 There are several ways that these assumptions can be violated, both 3173 by misconfiguration and by attacks. For example, on a web server 3174 that allows non-administrative users to write to .well-known, any 3175 user can claim to own the web server's hostname by responding to an 3176 HTTP challenge, and likewise for TLS configuration and TLS SNI. 3177 Similarly, if a server that can be used for ACME validation is 3178 compromised by a malicious actor, then that malicious actor can use 3179 that access to obtain certificates via ACME. 3181 The use of hosting providers is a particular risk for ACME 3182 validation. If the owner of the domain has outsourced operation of 3183 DNS or web services to a hosting provider, there is nothing that can 3184 be done against tampering by the hosting provider. As far as the 3185 outside world is concerned, the zone or website provided by the 3186 hosting provider is the real thing. 3188 More limited forms of delegation can also lead to an unintended party 3189 gaining the ability to successfully complete a validation 3190 transaction. For example, suppose an ACME server follows HTTP 3191 redirects in HTTP validation and a website operator provisions a 3192 catch-all redirect rule that redirects requests for unknown resources 3193 to a different domain. Then the target of the redirect could use 3194 that to get a certificate through HTTP validation since the 3195 validation path will not be known to the primary server. 3197 The DNS is a common point of vulnerability for all of these 3198 challenges. An entity that can provision false DNS records for a 3199 domain can attack the DNS challenge directly and can provision false 3200 A/AAAA records to direct the ACME server to send its TLS SNI or HTTP 3201 validation query to a remote server of the attacker's choosing. 3202 There are a few different mitigations that ACME servers can apply: 3204 o Always querying the DNS using a DNSSEC-validating resolver 3205 (enhancing security for zones that are DNSSEC-enabled) 3207 o Querying the DNS from multiple vantage points to address local 3208 attackers 3210 o Applying mitigations against DNS off-path attackers, e.g., adding 3211 entropy to requests [I-D.vixie-dnsext-dns0x20] or only using TCP 3213 Given these considerations, the ACME validation process makes it 3214 impossible for any attacker on the ACME channel or a passive attacker 3215 on the validation channel to hijack the authorization process to 3216 authorize a key of the attacker's choice. 3218 An attacker that can only see the ACME channel would need to convince 3219 the validation server to provide a response that would authorize the 3220 attacker's account key, but this is prevented by binding the 3221 validation response to the account key used to request challenges. A 3222 passive attacker on the validation channel can observe the correct 3223 validation response and even replay it, but that response can only be 3224 used with the account key for which it was generated. 3226 An active attacker on the validation channel can subvert the ACME 3227 process, by performing normal ACME transactions and providing a 3228 validation response for his own account key. The risks due to 3229 hosting providers noted above are a particular case. 3231 It is RECOMMENDED that the server perform DNS queries and make HTTP 3232 and TLS connections from various network perspectives, in order to 3233 make MitM attacks harder. 3235 10.3. Denial-of-Service Considerations 3237 As a protocol run over HTTPS, standard considerations for TCP-based 3238 and HTTP-based DoS mitigation also apply to ACME. 3240 At the application layer, ACME requires the server to perform a few 3241 potentially expensive operations. Identifier validation transactions 3242 require the ACME server to make outbound connections to potentially 3243 attacker-controlled servers, and certificate issuance can require 3244 interactions with cryptographic hardware. 3246 In addition, an attacker can also cause the ACME server to send 3247 validation requests to a domain of its choosing by submitting 3248 authorization requests for the victim domain. 3250 All of these attacks can be mitigated by the application of 3251 appropriate rate limits. Issues closer to the front end, like POST 3252 body validation, can be addressed using HTTP request limiting. For 3253 validation and certificate requests, there are other identifiers on 3254 which rate limits can be keyed. For example, the server might limit 3255 the rate at which any individual account key can issue certificates 3256 or the rate at which validation can be requested within a given 3257 subtree of the DNS. And in order to prevent attackers from 3258 circumventing these limits simply by minting new accounts, servers 3259 would need to limit the rate at which accounts can be registered. 3261 10.4. Server-Side Request Forgery 3263 Server-Side Request Forgery (SSRF) attacks can arise when an attacker 3264 can cause a server to perform HTTP requests to an attacker-chosen 3265 URL. In the ACME HTTP challenge validation process, the ACME server 3266 performs an HTTP GET request to a URL in which the attacker can 3267 choose the domain. This request is made before the server has 3268 verified that the client controls the domain, so any client can cause 3269 a query to any domain. 3271 Some server implementations include information from the validation 3272 server's response (in order to facilitate debugging). Such 3273 implementations enable an attacker to extract this information from 3274 any web server that is accessible to the ACME server, even if it is 3275 not accessible to the ACME client. 3277 It might seem that the risk of SSRF through this channel is limited 3278 by the fact that the attacker can only control the domain of the URL, 3279 not the path. However, if the attacker first sets the domain to one 3280 they control, then they can send the server an HTTP redirect (e.g., a 3281 302 response) which will cause the server to query an arbitrary URL. 3283 In order to further limit the SSRF risk, ACME server operators should 3284 ensure that validation queries can only be sent to servers on the 3285 public Internet, and not, say, web services within the server 3286 operator's internal network. Since the attacker could make requests 3287 to these public servers himself, he can't gain anything extra through 3288 an SSRF attack on ACME aside from a layer of anonymization. 3290 10.5. CA Policy Considerations 3292 The controls on issuance enabled by ACME are focused on validating 3293 that a certificate applicant controls the identifier he claims. 3294 Before issuing a certificate, however, there are many other checks 3295 that a CA might need to perform, for example: 3297 o Has the client agreed to a subscriber agreement? 3299 o Is the claimed identifier syntactically valid? 3300 o For domain names: 3302 * If the leftmost label is a '*', then have the appropriate 3303 checks been applied? 3305 * Is the name on the Public Suffix List? 3307 * Is the name a high-value name? 3309 * Is the name a known phishing domain? 3311 o Is the key in the CSR sufficiently strong? 3313 o Is the CSR signed with an acceptable algorithm? 3315 o Has issuance been authorized or forbidden by a Certificate 3316 Authority Authorization (CAA) record? [RFC6844] 3318 CAs that use ACME to automate issuance will need to ensure that their 3319 servers perform all necessary checks before issuing. 3321 CAs using ACME to allow clients to agree to terms of service should 3322 keep in mind that ACME clients can automate this agreement, possibly 3323 not involving a human user. 3325 11. Operational Considerations 3327 There are certain factors that arise in operational reality that 3328 operators of ACME-based CAs will need to keep in mind when 3329 configuring their services. For example: 3331 11.1. DNS security 3333 As noted above, DNS forgery attacks against the ACME server can 3334 result in the server making incorrect decisions about domain control 3335 and thus mis-issuing certificates. Servers SHOULD perform DNS 3336 queries over TCP, which provides better resistance to some forgery 3337 attacks than DNS over UDP. 3339 An ACME-based CA will often need to make DNS queries, e.g., to 3340 validate control of DNS names. Because the security of such 3341 validations ultimately depends on the authenticity of DNS data, every 3342 possible precaution should be taken to secure DNS queries done by the 3343 CA. It is therefore RECOMMENDED that ACME-based CAs make all DNS 3344 queries via DNSSEC-validating stub or recursive resolvers. This 3345 provides additional protection to domains which choose to make use of 3346 DNSSEC. 3348 An ACME-based CA must use only a resolver if it trusts the resolver 3349 and every component of the network route by which it is accessed. It 3350 is therefore RECOMMENDED that ACME-based CAs operate their own 3351 DNSSEC-validating resolvers within their trusted network and use 3352 these resolvers both for both CAA record lookups and all record 3353 lookups in furtherance of a challenge scheme (A, AAAA, TXT, etc.). 3355 11.2. Default Virtual Hosts 3357 In many cases, TLS-based services are deployed on hosted platforms 3358 that use the Server Name Indication (SNI) TLS extension to 3359 distinguish between different hosted services or "virtual hosts". 3360 When a client initiates a TLS connection with an SNI value indicating 3361 a provisioned host, the hosting platform routes the connection to 3362 that host. 3364 When a connection comes in with an unknown SNI value, one might 3365 expect the hosting platform to terminate the TLS connection. 3366 However, some hosting platforms will choose a virtual host to be the 3367 "default", and route connections with unknown SNI values to that 3368 host. 3370 In such cases, the owner of the default virtual host can complete a 3371 TLS-based challenge (e.g., "tls-sni-02") for any domain with an A 3372 record that points to the hosting platform. This could result in 3373 mis-issuance in cases where there are multiple hosts with different 3374 owners resident on the hosting platform. 3376 A CA that accepts TLS-based proof of domain control should attempt to 3377 check whether a domain is hosted on a domain with a default virtual 3378 host before allowing an authorization request for this host to use a 3379 TLS-based challenge. Typically, systems with default virtual hosts 3380 do not allow the holder of the default virtual host to control what 3381 certificates are presented on a request-by-request basis. Rather, 3382 the default virtual host can configure which certificate is presented 3383 in TLS on a fairly static basis, so that the certificate presented 3384 should be stable over small intervals. 3386 A CA can detect such a bounded default vhost by initiating TLS 3387 connections to the host with random SNI values within the namespace 3388 used for the TLS-based challenge (the "acme.invalid" namespace for 3389 "tls-sni-02"). If it receives the same certificate on two different 3390 connections, then it is very likely that the server is in a default 3391 virtual host configuration. Conversely, if the TLS server returns an 3392 unrecognized_name alert, then this is an indication that the server 3393 is not in a default virtual host configuration. 3395 11.3. Token Entropy 3397 The http-01, tls-sni-02 and dns-01 validation methods mandate the 3398 usage of a random token value to uniquely identify the challenge. 3399 The value of the token is required to contain at least 128 bits of 3400 entropy for the following security properties. First, the ACME 3401 client should not be able to influence the ACME server's choice of 3402 token as this may allow an attacker to reuse a domain owner's 3403 previous challenge responses for a new validation request. Secondly, 3404 the entropy requirement prevents ACME clients from implementing a 3405 "naive" validation server that automatically replies to challenges 3406 without participating in the creation of the initial authorization 3407 request. 3409 11.4. Malformed Certificate Chains 3411 ACME provides certificate chains in the widely-used format known 3412 colloquially as PEM (though it may diverge from the actual Privacy 3413 Enhanced Mail specifications [RFC1421], as noted in [RFC7468]). Some 3414 current software will allow the configuration of a private key and a 3415 certificate in one PEM file, by concatenating the textual encodings 3416 of the two objects. In the context of ACME, such software might be 3417 vulnerable to "key replacement" attacks. A malicious ACME server 3418 could cause a client to use a private key of its choosing by 3419 including the key in the PEM file returned in response to a query for 3420 a certificate URL. 3422 When processing an file of type "application/pem-certificate-chain", 3423 a client SHOULD verify that the file contains only encoded 3424 certificates. If anything other than a certificate is found (i.e., 3425 if the string "---BEGIN" is ever followed by anything other than 3426 "CERTIFICATE"), then the client MUST reject the file as invalid. 3428 12. Acknowledgements 3430 In addition to the editors listed on the front page, this document 3431 has benefited from contributions from a broad set of contributors, 3432 all the way back to its inception. 3434 o Peter Eckersley, EFF 3436 o Eric Rescorla, Mozilla 3438 o Seth Schoen, EFF 3440 o Alex Halderman, University of Michigan 3442 o Martin Thomson, Mozilla 3443 o Jakub Warmuz, University of Oxford 3445 This document draws on many concepts established by Eric Rescorla's 3446 "Automated Certificate Issuance Protocol" draft. Martin Thomson 3447 provided helpful guidance in the use of HTTP. 3449 13. References 3451 13.1. Normative References 3453 [FIPS180-4] 3454 Department of Commerce, National., "NIST FIPS 180-4, 3455 Secure Hash Standard", March 2012, 3456 . 3459 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 3460 Requirement Levels", BCP 14, RFC 2119, 3461 DOI 10.17487/RFC2119, March 1997, 3462 . 3464 [RFC2585] Housley, R. and P. Hoffman, "Internet X.509 Public Key 3465 Infrastructure Operational Protocols: FTP and HTTP", 3466 RFC 2585, DOI 10.17487/RFC2585, May 1999, 3467 . 3469 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, 3470 DOI 10.17487/RFC2818, May 2000, 3471 . 3473 [RFC2985] Nystrom, M. and B. Kaliski, "PKCS #9: Selected Object 3474 Classes and Attribute Types Version 2.0", RFC 2985, 3475 DOI 10.17487/RFC2985, November 2000, 3476 . 3478 [RFC2986] Nystrom, M. and B. Kaliski, "PKCS #10: Certification 3479 Request Syntax Specification Version 1.7", RFC 2986, 3480 DOI 10.17487/RFC2986, November 2000, 3481 . 3483 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 3484 Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002, 3485 . 3487 [RFC3492] Costello, A., "Punycode: A Bootstring encoding of Unicode 3488 for Internationalized Domain Names in Applications 3489 (IDNA)", RFC 3492, DOI 10.17487/RFC3492, March 2003, 3490 . 3492 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 3493 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November 3494 2003, . 3496 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 3497 Resource Identifier (URI): Generic Syntax", STD 66, 3498 RFC 3986, DOI 10.17487/RFC3986, January 2005, 3499 . 3501 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 3502 Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, 3503 . 3505 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 3506 (TLS) Protocol Version 1.2", RFC 5246, 3507 DOI 10.17487/RFC5246, August 2008, 3508 . 3510 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 3511 Housley, R., and W. Polk, "Internet X.509 Public Key 3512 Infrastructure Certificate and Certificate Revocation List 3513 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 3514 . 3516 [RFC5890] Klensin, J., "Internationalized Domain Names for 3517 Applications (IDNA): Definitions and Document Framework", 3518 RFC 5890, DOI 10.17487/RFC5890, August 2010, 3519 . 3521 [RFC5988] Nottingham, M., "Web Linking", RFC 5988, 3522 DOI 10.17487/RFC5988, October 2010, 3523 . 3525 [RFC6066] Eastlake 3rd, D., "Transport Layer Security (TLS) 3526 Extensions: Extension Definitions", RFC 6066, 3527 DOI 10.17487/RFC6066, January 2011, 3528 . 3530 [RFC6068] Duerst, M., Masinter, L., and J. Zawinski, "The 'mailto' 3531 URI Scheme", RFC 6068, DOI 10.17487/RFC6068, October 2010, 3532 . 3534 [RFC6570] Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., 3535 and D. Orchard, "URI Template", RFC 6570, 3536 DOI 10.17487/RFC6570, March 2012, 3537 . 3539 [RFC6844] Hallam-Baker, P. and R. Stradling, "DNS Certification 3540 Authority Authorization (CAA) Resource Record", RFC 6844, 3541 DOI 10.17487/RFC6844, January 2013, 3542 . 3544 [RFC7159] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 3545 Interchange Format", RFC 7159, DOI 10.17487/RFC7159, March 3546 2014, . 3548 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 3549 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 3550 DOI 10.17487/RFC7231, June 2014, 3551 . 3553 [RFC7468] Josefsson, S. and S. Leonard, "Textual Encodings of PKIX, 3554 PKCS, and CMS Structures", RFC 7468, DOI 10.17487/RFC7468, 3555 April 2015, . 3557 [RFC7515] Jones, M., Bradley, J., and N. Sakimura, "JSON Web 3558 Signature (JWS)", RFC 7515, DOI 10.17487/RFC7515, May 3559 2015, . 3561 [RFC7518] Jones, M., "JSON Web Algorithms (JWA)", RFC 7518, 3562 DOI 10.17487/RFC7518, May 2015, 3563 . 3565 [RFC7638] Jones, M. and N. Sakimura, "JSON Web Key (JWK) 3566 Thumbprint", RFC 7638, DOI 10.17487/RFC7638, September 3567 2015, . 3569 [RFC7807] Nottingham, M. and E. Wilde, "Problem Details for HTTP 3570 APIs", RFC 7807, DOI 10.17487/RFC7807, March 2016, 3571 . 3573 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 3574 Writing an IANA Considerations Section in RFCs", BCP 26, 3575 RFC 8126, DOI 10.17487/RFC8126, June 2017, 3576 . 3578 13.2. Informative References 3580 [I-D.ietf-acme-caa] 3581 Landau, H., "CAA Record Extensions for Account URI and 3582 ACME Method Binding", draft-ietf-acme-caa-03 (work in 3583 progress), August 2017. 3585 [I-D.ietf-acme-ip] 3586 Shoemaker, R., "ACME IP Identifier Validation Extension", 3587 draft-ietf-acme-ip-01 (work in progress), September 2017. 3589 [I-D.ietf-acme-telephone] 3590 Peterson, J. and R. Barnes, "ACME Identifiers and 3591 Challenges for Telephone Numbers", draft-ietf-acme- 3592 telephone-01 (work in progress), October 2017. 3594 [I-D.vixie-dnsext-dns0x20] 3595 Vixie, P. and D. Dagon, "Use of Bit 0x20 in DNS Labels to 3596 Improve Transaction Identity", draft-vixie-dnsext- 3597 dns0x20-00 (work in progress), March 2008. 3599 [RFC1421] Linn, J., "Privacy Enhancement for Internet Electronic 3600 Mail: Part I: Message Encryption and Authentication 3601 Procedures", RFC 1421, DOI 10.17487/RFC1421, February 3602 1993, . 3604 [RFC3552] Rescorla, E. and B. Korver, "Guidelines for Writing RFC 3605 Text on Security Considerations", BCP 72, RFC 3552, 3606 DOI 10.17487/RFC3552, July 2003, 3607 . 3609 [RFC3553] Mealling, M., Masinter, L., Hardie, T., and G. Klyne, "An 3610 IETF URN Sub-namespace for Registered Protocol 3611 Parameters", BCP 73, RFC 3553, DOI 10.17487/RFC3553, June 3612 2003, . 3614 [RFC5785] Nottingham, M. and E. Hammer-Lahav, "Defining Well-Known 3615 Uniform Resource Identifiers (URIs)", RFC 5785, 3616 DOI 10.17487/RFC5785, April 2010, 3617 . 3619 [RFC7525] Sheffer, Y., Holz, R., and P. Saint-Andre, 3620 "Recommendations for Secure Use of Transport Layer 3621 Security (TLS) and Datagram Transport Layer Security 3622 (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May 3623 2015, . 3625 [W3C.CR-cors-20130129] 3626 Kesteren, A., "Cross-Origin Resource Sharing", World Wide 3627 Web Consortium CR CR-cors-20130129, January 2013, 3628 . 3630 13.3. URIs 3632 [1] https://github.com/ietf-wg-acme/acme 3634 Authors' Addresses 3636 Richard Barnes 3637 Cisco 3639 Email: rlb@ipv.sx 3641 Jacob Hoffman-Andrews 3642 EFF 3644 Email: jsha@eff.org 3646 Daniel McCarney 3647 Let's Encrypt 3649 Email: cpu@letsencrypt.org 3651 James Kasten 3652 University of Michigan 3654 Email: jdkasten@umich.edu