idnits 2.17.1 draft-ietf-acme-acme-04.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 736 has weird spacing: '...new-reg new-...' -- 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 (October 31, 2016) is 2733 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) == Missing Reference: 'A-Z' is mentioned on line 557, but not defined == Missing Reference: '0-9' is mentioned on line 557, but not defined ** 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) -- Obsolete informational reference (is this intentional?): RFC 5226 (Obsoleted by RFC 8126) -- Obsolete informational reference (is this intentional?): RFC 5785 (Obsoleted by RFC 8615) -- Obsolete informational reference (is this intentional?): RFC 6962 (Obsoleted by RFC 9162) Summary: 9 errors (**), 0 flaws (~~), 4 warnings (==), 6 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group R. Barnes 3 Internet-Draft Mozilla 4 Intended status: Standards Track J. Hoffman-Andrews 5 Expires: May 4, 2017 EFF 6 J. Kasten 7 University of Michigan 8 October 31, 2016 10 Automatic Certificate Management Environment (ACME) 11 draft-ietf-acme-acme-04 13 Abstract 15 Certificates in the Web's X.509 PKI (PKIX) are used for a number of 16 purposes, the most significant of which is the authentication of 17 domain names. Thus, certificate authorities in the Web PKI are 18 trusted to verify that an applicant for a certificate legitimately 19 represents the domain name(s) in the certificate. Today, this 20 verification is done through a collection of ad hoc mechanisms. This 21 document describes a protocol that a certificate authority (CA) and 22 an applicant can use to automate the process of verification and 23 certificate issuance. The protocol also provides facilities for 24 other certificate management functions, such as certificate 25 revocation. 27 DISCLAIMER: This is a work in progress draft of ACME and has not yet 28 had a thorough security analysis. 30 RFC EDITOR: PLEASE REMOVE THE FOLLOWING PARAGRAPH: The source for 31 this draft is maintained in GitHub. Suggested changes should be 32 submitted as pull requests at https://github.com/ietf-wg-acme/acme . 33 Instructions are on that page as well. Editorial changes can be 34 managed in GitHub, but any substantive change should be discussed on 35 the ACME mailing list (acme@ietf.org). 37 Status of This Memo 39 This Internet-Draft is submitted in full conformance with the 40 provisions of BCP 78 and BCP 79. 42 Internet-Drafts are working documents of the Internet Engineering 43 Task Force (IETF). Note that other groups may also distribute 44 working documents as Internet-Drafts. The list of current Internet- 45 Drafts is at http://datatracker.ietf.org/drafts/current/. 47 Internet-Drafts are draft documents valid for a maximum of six months 48 and may be updated, replaced, or obsoleted by other documents at any 49 time. It is inappropriate to use Internet-Drafts as reference 50 material or to cite them other than as "work in progress." 52 This Internet-Draft will expire on May 4, 2017. 54 Copyright Notice 56 Copyright (c) 2016 IETF Trust and the persons identified as the 57 document authors. All rights reserved. 59 This document is subject to BCP 78 and the IETF Trust's Legal 60 Provisions Relating to IETF Documents 61 (http://trustee.ietf.org/license-info) in effect on the date of 62 publication of this document. Please review these documents 63 carefully, as they describe your rights and restrictions with respect 64 to this document. Code Components extracted from this document must 65 include Simplified BSD License text as described in Section 4.e of 66 the Trust Legal Provisions and are provided without warranty as 67 described in the Simplified BSD License. 69 Table of Contents 71 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 72 2. Deployment Model and Operator Experience . . . . . . . . . . 4 73 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 6 74 4. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 6 75 5. Message Transport . . . . . . . . . . . . . . . . . . . . . . 8 76 5.1. HTTPS Requests . . . . . . . . . . . . . . . . . . . . . 8 77 5.2. Request Authentication . . . . . . . . . . . . . . . . . 9 78 5.3. Equivalence of JWKs . . . . . . . . . . . . . . . . . . . 10 79 5.4. Request URI Integrity . . . . . . . . . . . . . . . . . . 10 80 5.4.1. "url" (URL) JWS header parameter . . . . . . . . . . 11 81 5.5. Replay protection . . . . . . . . . . . . . . . . . . . . 11 82 5.5.1. Replay-Nonce . . . . . . . . . . . . . . . . . . . . 12 83 5.5.2. "nonce" (Nonce) JWS header parameter . . . . . . . . 12 84 5.6. Rate limits . . . . . . . . . . . . . . . . . . . . . . . 13 85 5.7. Errors . . . . . . . . . . . . . . . . . . . . . . . . . 13 86 6. Certificate Management . . . . . . . . . . . . . . . . . . . 15 87 6.1. Resources . . . . . . . . . . . . . . . . . . . . . . . . 15 88 6.1.1. Directory . . . . . . . . . . . . . . . . . . . . . . 17 89 6.1.2. Registration Objects . . . . . . . . . . . . . . . . 19 90 6.1.3. Application Objects . . . . . . . . . . . . . . . . . 20 91 6.1.4. Authorization Objects . . . . . . . . . . . . . . . . 23 92 6.2. Getting a Nonce . . . . . . . . . . . . . . . . . . . . . 25 93 6.3. Registration . . . . . . . . . . . . . . . . . . . . . . 25 94 6.3.1. Changes of Terms of Service . . . . . . . . . . . . . 28 95 6.3.2. Account Key Roll-over . . . . . . . . . . . . . . . . 29 96 6.3.3. Account deactivation . . . . . . . . . . . . . . . . 31 98 6.4. Applying for Certificate Issuance . . . . . . . . . . . . 32 99 6.4.1. Pre-Authorization . . . . . . . . . . . . . . . . . . 34 100 6.4.2. Downloading the Certificate . . . . . . . . . . . . . 36 101 6.5. Identifier Authorization . . . . . . . . . . . . . . . . 38 102 6.5.1. Responding to Challenges . . . . . . . . . . . . . . 39 103 6.5.2. Deactivating an Authorization . . . . . . . . . . . . 41 104 6.6. Certificate Revocation . . . . . . . . . . . . . . . . . 42 105 7. Identifier Validation Challenges . . . . . . . . . . . . . . 44 106 7.1. Key Authorizations . . . . . . . . . . . . . . . . . . . 46 107 7.2. HTTP . . . . . . . . . . . . . . . . . . . . . . . . . . 46 108 7.3. TLS with Server Name Indication (TLS SNI) . . . . . . . . 48 109 7.4. DNS . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 110 7.5. Out-of-Band . . . . . . . . . . . . . . . . . . . . . . . 52 111 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 52 112 8.1. Well-Known URI for the HTTP Challenge . . . . . . . . . . 53 113 8.2. Replay-Nonce HTTP Header . . . . . . . . . . . . . . . . 53 114 8.3. "url" JWS Header Parameter . . . . . . . . . . . . . . . 53 115 8.4. "nonce" JWS Header Parameter . . . . . . . . . . . . . . 53 116 8.5. URN Sub-namespace for ACME (urn:ietf:params:acme) . . . . 54 117 8.6. New Registries . . . . . . . . . . . . . . . . . . . . . 54 118 8.6.1. Error Codes . . . . . . . . . . . . . . . . . . . . . 54 119 8.6.2. Resource Types . . . . . . . . . . . . . . . . . . . 55 120 8.6.3. Identifier Types . . . . . . . . . . . . . . . . . . 55 121 8.6.4. Challenge Types . . . . . . . . . . . . . . . . . . . 56 122 9. Security Considerations . . . . . . . . . . . . . . . . . . . 57 123 9.1. Threat model . . . . . . . . . . . . . . . . . . . . . . 57 124 9.2. Integrity of Authorizations . . . . . . . . . . . . . . . 58 125 9.3. Denial-of-Service Considerations . . . . . . . . . . . . 60 126 9.4. Server-Side Request Forgery . . . . . . . . . . . . . . . 61 127 9.5. CA Policy Considerations . . . . . . . . . . . . . . . . 62 128 10. Operational Considerations . . . . . . . . . . . . . . . . . 62 129 10.1. DNS over TCP . . . . . . . . . . . . . . . . . . . . . . 62 130 10.2. Default Virtual Hosts . . . . . . . . . . . . . . . . . 63 131 10.3. Use of DNSSEC Resolvers . . . . . . . . . . . . . . . . 63 132 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 64 133 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 64 134 12.1. Normative References . . . . . . . . . . . . . . . . . . 64 135 12.2. Informative References . . . . . . . . . . . . . . . . . 66 136 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 67 138 1. Introduction 140 Certificates in the Web PKI [RFC5280] are most commonly used to 141 authenticate domain names. Thus, certificate authorities in the Web 142 PKI are trusted to verify that an applicant for a certificate 143 legitimately represents the domain name(s) in the certificate. 145 Existing Web PKI certificate authorities tend to run on a set of ad 146 hoc protocols for certificate issuance and identity verification. A 147 typical user experience is something like: 149 o Generate a PKCS#10 [RFC2986] Certificate Signing Request (CSR). 151 o Cut-and-paste the CSR into a CA web page. 153 o Prove ownership of the domain by one of the following methods: 155 * Put a CA-provided challenge at a specific place on the web 156 server. 158 * Put a CA-provided challenge at a DNS location corresponding to 159 the target domain. 161 * Receive CA challenge at a (hopefully) administrator-controlled 162 e-mail address corresponding to the domain and then respond to 163 it on the CA's web page. 165 o Download the issued certificate and install it on their Web 166 Server. 168 With the exception of the CSR itself and the certificates that are 169 issued, these are all completely ad hoc procedures and are 170 accomplished by getting the human user to follow interactive natural- 171 language instructions from the CA rather than by machine-implemented 172 published protocols. In many cases, the instructions are difficult 173 to follow and cause significant confusion. Informal usability tests 174 by the authors indicate that webmasters often need 1-3 hours to 175 obtain and install a certificate for a domain. Even in the best 176 case, the lack of published, standardized mechanisms presents an 177 obstacle to the wide deployment of HTTPS and other PKIX-dependent 178 systems because it inhibits mechanization of tasks related to 179 certificate issuance, deployment, and revocation. 181 This document describes an extensible framework for automating the 182 issuance and domain validation procedure, thereby allowing servers 183 and infrastructural software to obtain certificates without user 184 interaction. Use of this protocol should radically simplify the 185 deployment of HTTPS and the practicality of PKIX authentication for 186 other protocols based on TLS [RFC5246]. 188 2. Deployment Model and Operator Experience 190 The major guiding use case for ACME is obtaining certificates for Web 191 sites (HTTPS [RFC2818]). In that case, the server is intended to 192 speak for one or more domains, and the process of certificate 193 issuance is intended to verify that the server actually speaks for 194 the domain(s). 196 Different types of certificates reflect different kinds of CA 197 verification of information about the certificate subject. "Domain 198 Validation" (DV) certificates are by far the most common type. For 199 DV validation, the CA merely verifies that the requester has 200 effective control of the web server and/or DNS server for the domain, 201 but does not explicitly attempt to verify their real-world identity. 202 (This is as opposed to "Organization Validation" (OV) and "Extended 203 Validation" (EV) certificates, where the process is intended to also 204 verify the real-world identity of the requester.) 206 DV certificate validation commonly checks claims about properties 207 related to control of a domain name - properties that can be observed 208 by the issuing authority in an interactive process that can be 209 conducted purely online. That means that under typical 210 circumstances, all steps in the request, verification, and issuance 211 process can be represented and performed by Internet protocols with 212 no out-of-band human intervention. 214 When deploying a current HTTPS server, an operator generally gets a 215 prompt to generate a self-signed certificate. When an operator 216 deploys an ACME-compatible web server, the experience would be 217 something like this: 219 o The ACME client prompts the operator for the intended domain 220 name(s) that the web server is to stand for. 222 o The ACME client presents the operator with a list of CAs from 223 which it could get a certificate. (This list will change over 224 time based on the capabilities of CAs and updates to ACME 225 configuration.) The ACME client might prompt the operator for 226 payment information at this point. 228 o The operator selects a CA. 230 o In the background, the ACME client contacts the CA and requests 231 that a certificate be issued for the intended domain name(s). 233 o Once the CA is satisfied, the certificate is issued and the ACME 234 client automatically downloads and installs it, potentially 235 notifying the operator via e-mail, SMS, etc. 237 o The ACME client periodically contacts the CA to get updated 238 certificates, stapled OCSP responses, or whatever else would be 239 required to keep the server functional and its credentials up-to- 240 date. 242 The overall idea is that it's nearly as easy to deploy with a CA- 243 issued certificate as a self-signed certificate, and that once the 244 operator has done so, the process is self-sustaining with minimal 245 manual intervention. Close integration of ACME with HTTPS servers, 246 for example, can allow the immediate and automated deployment of 247 certificates as they are issued, optionally sparing the human 248 administrator from additional configuration work. 250 3. Terminology 252 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 253 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 254 document are to be interpreted as described in RFC 2119 [RFC2119]. 256 The two main roles in ACME are "client" and "server". The ACME 257 client uses the protocol to request certificate management actions, 258 such as issuance or revocation. An ACME client therefore typically 259 runs on a web server, mail server, or some other server system which 260 requires valid TLS certificates. The ACME server runs at a 261 certificate authority, and responds to client requests, performing 262 the requested actions if the client is authorized. 264 An ACME client is represented by an "account key pair". The client 265 uses the private key of this key pair to sign all messages sent to 266 the server. The server uses the public key to verify the 267 authenticity and integrity of messages from the client. 269 4. Protocol Overview 271 ACME allows a client to request certificate management actions using 272 a set of JSON messages carried over HTTPS. In some ways, ACME 273 functions much like a traditional CA, in which a user creates an 274 account, adds identifiers to that account (proving control of the 275 domains), and requests certificate issuance for those domains while 276 logged in to the account. 278 In ACME, the account is represented by an account key pair. The "add 279 a domain" function is accomplished by authorizing the key pair for a 280 given domain. Certificate issuance and revocation are authorized by 281 a signature with the key pair. 283 The first phase of ACME is for the client to register with the ACME 284 server. The client generates an asymmetric key pair and associates 285 this key pair with a set of contact information by signing the 286 contact information. The server acknowledges the registration by 287 replying with a registration object echoing the client's input. 289 Client Server 291 Contact Information 292 Signature -------> 294 <------- Registration 296 Once the client is registered, there are three major steps it needs 297 to take to get a certificate: 299 1. Apply for a certificate to be issued 301 2. Fulfill the server's requirements for issuance 303 3. Await issuance and download the issued certificate 305 The client's application for a certificate describes the desired 306 certificate using a PKCS#10 Certificate Signing Request (CSR) plus a 307 few additional fields that capture semantics that are not supported 308 in the CSR format. If the server is willing to consider issuing such 309 a certificate, it responds with a list of requirements that the 310 client must satisfy before the certificate will be issued. 312 For example, in most cases, the server will require the client to 313 demonstrate that it controls the identifiers in the requested 314 certificate. Because there are many different ways to validate 315 possession of different types of identifiers, the server will choose 316 from an extensible set of challenges that are appropriate for the 317 identifier being claimed. The client responds with a set of 318 responses that tell the server which challenges the client has 319 completed. The server then validates the challenges to check that 320 the client has accomplished the challenge. 322 Once the validation process is complete and the server is satisfied 323 that the client has met its requirements, the server will issue the 324 requested certificate and make it available to the client. 326 Application 327 Signature -------> 328 <------- Requirements 329 (e.g., Challenges) 331 Responses 332 Signature -------> 334 <~~~~~~~~Validation~~~~~~~~> 336 <------- Certificate 338 To revoke a certificate, the client simply sends a revocation request 339 indicating the certificate to be revoked, signed with an authorized 340 key pair. The server indicates whether the request has succeeded. 342 Client Server 344 Revocation request 345 Signature --------> 347 <-------- Result 349 Note that while ACME is defined with enough flexibility to handle 350 different types of identifiers in principle, the primary use case 351 addressed by this document is the case where domain names are used as 352 identifiers. For example, all of the identifier validation 353 challenges described in Section 7 below address validation of domain 354 names. The use of ACME for other protocols will require further 355 specification, in order to describe how these identifiers are encoded 356 in the protocol, and what types of validation challenges the server 357 might require. 359 5. Message Transport 361 Communications between an ACME client and an ACME server are done 362 over HTTPS, using JSON Web Signature (JWS) [RFC7515] to provide some 363 additional security properties for messages sent from the client to 364 the server. HTTPS provides server authentication and 365 confidentiality. With some ACME-specific extensions, JWS provides 366 authentication of the client's request payloads, anti-replay 367 protection, and integrity for the HTTPS request URI. 369 5.1. HTTPS Requests 371 Each ACME function is accomplished by the client sending a sequence 372 of HTTPS requests to the server, carrying JSON messages 373 [RFC2818][RFC7159]. Use of HTTPS is REQUIRED. Clients SHOULD 374 support HTTP public key pinning [RFC7469], and servers SHOULD emit 375 pinning headers. Each subsection of Section 6 below describes the 376 message formats used by the function, and the order in which messages 377 are sent. 379 In most HTTPS transactions used by ACME, the ACME client is the HTTPS 380 client and the ACME server is the HTTPS server. The ACME server acts 381 as an HTTP and HTTPS client when validating challenges via HTTP. 383 ACME clients SHOULD send a User-Agent header in accordance with 384 [RFC7231], including the name and version of the ACME software in 385 addition to the name and version of the underlying HTTP client 386 software. 388 ACME clients SHOULD send an Accept-Language header in accordance with 389 [RFC7231] to enable localization of error messages. 391 ACME servers that are intended to be generally accessible need to use 392 Cross-Origin Resource Sharing (CORS) in order to be accessible from 393 browser-based clients [W3C.CR-cors-20130129]. Such servers SHOULD 394 set the Access-Control-Allow-Origin header field to the value "*". 396 Binary fields in the JSON objects used by ACME are encoded using 397 base64url encoding described in [RFC4648] Section 5, according to the 398 profile specified in JSON Web Signature [RFC7515] Section 2. This 399 encoding uses a URL safe character set. Trailing '=' characters MUST 400 be stripped. 402 5.2. Request Authentication 404 All ACME requests with a non-empty body MUST encapsulate the body in 405 a JWS object, signed using the account key pair. The server MUST 406 verify the JWS before processing the request. (For readability, 407 however, the examples below omit this encapsulation.) Encapsulating 408 request bodies in JWS provides a simple authentication of requests by 409 way of key continuity. 411 JWS objects sent in ACME requests MUST meet the following additional 412 criteria: 414 o The JWS MUST be encoded using UTF-8 416 o The JWS MUST NOT have the value "none" in its "alg" field 418 o The JWS Protected Header MUST include the following fields: 420 * "alg" 422 * "jwk" (only for requests to new-reg and revoke-cert resources) 424 * "kid" (for all other requests). 426 * "nonce" (defined below) 428 * "url" (defined below) 430 The "jwk" and "kid" fields are mutually exclusive. Servers MUST 431 reject requests that contain both. 433 For new-reg requests, and for revoke-cert requests authenticated by 434 certificate key, there MUST be a "jwk" field. 436 For all other requests, there MUST be a "kid" field. This field must 437 contain the account URI received by POSTing to the new-reg resource. 439 Note that authentication via signed POST implies that GET requests 440 are not authenticated. Servers MUST NOT respond to GET requests for 441 resources that might be considered sensitive. 443 In the examples below, JWS objects are shown in the JSON or flattened 444 JSON serialization, with the protected header and payload expressed 445 as base64url(content) instead of the actual base64-encoded value, so 446 that the content is readable. Some fields are omitted for brevity, 447 marked with "...". 449 5.3. Equivalence of JWKs 451 At some points in the protocol, it is necessary for the server to 452 determine whether two JSON Web Key (JWK) [RFC7517] objects represent 453 the same key. In performing these checks, the server MUST consider 454 two JWKs to match if and only if they have the identical values in 455 all fields included in the computation of a JWK thumbprint for that 456 key. That is, the keys must have the same "kty" value and contain 457 identical values in the fields used in the computation of a JWK 458 thumbprint for that key type: 460 o "RSA": "n", "e" 462 o "EC": "crv", "x", "y" 464 Note that this comparison is equivalent to computing the JWK 465 thumbprints of the two keys and comparing thumbprints. The only 466 difference is that there is no requirement for a hash computation 467 (and thus it is independent of the choice of hash function) and no 468 risk of hash collision. 470 5.4. Request URI Integrity 472 It is common in deployment for the entity terminating TLS for HTTPS 473 to be different from the entity operating the logical HTTPS server, 474 with a "request routing" layer in the middle. For example, an ACME 475 CA might have a content delivery network terminate TLS connections 476 from clients so that it can inspect client requests for denial-of- 477 service protection. 479 These intermediaries can also change values in the request that are 480 not signed in the HTTPS request, e.g., the request URI and headers. 482 ACME uses JWS to provide a limited integrity mechanism, which 483 protects against an intermediary changing the request URI to another 484 ACME URI of a different type. (It does not protect against changing 485 between URIs of the same type, e.g., from one authorization URI to 486 another). 488 As noted above, all ACME request objects carry a "url" parameter in 489 their protected header. This header parameter encodes the URL to 490 which the client is directing the request. On receiving such an 491 object in an HTTP request, the server MUST compare the "url" 492 parameter to the request URI. If the two do not match, then the 493 server MUST reject the request as unauthorized. 495 Except for the directory resource, all ACME resources are addressed 496 with URLs provided to the client by the server. For these resources, 497 the client MUST set the "url" field to the exact string provided by 498 the server (rather than performing any re-encoding on the URL). The 499 server SHOULD perform the corresponding string equality check, 500 configuring each resource with the URL string provided to clients and 501 having the resource check that requests have the same string in their 502 "url" fields. 504 5.4.1. "url" (URL) JWS header parameter 506 The "url" header parameter specifies the URL to which this JWS object 507 is directed [RFC3986]. The "url" parameter MUST be carried in the 508 protected header of the JWS. The value of the "url" header MUST be a 509 JSON string representing the URL. 511 5.5. Replay protection 513 In order to protect ACME resources from any possible replay attacks, 514 ACME requests have a mandatory anti-replay mechanism. This mechanism 515 is based on the server maintaining a list of nonces that it has 516 issued to clients, and requiring any signed request from the client 517 to carry such a nonce. 519 An ACME server provides nonces to clients using the Replay-Nonce 520 header field, as specified below. The server MUST include a Replay- 521 Nonce header field in every successful response to a POST request, 522 and SHOULD provide it in error responses as well. 524 Every JWS sent by an ACME client MUST include, in its protected 525 header, the "nonce" header parameter, with contents as defined below. 526 As part of JWS verification, the ACME server MUST verify that the 527 value of the "nonce" header is a value that the server previously 528 provided in a Replay-Nonce header field. Once a nonce value has 529 appeared in an ACME request, the server MUST consider it invalid, in 530 the same way as a value it had never issued. 532 When a server rejects a request because its nonce value was 533 unacceptable (or not present), it SHOULD provide HTTP status code 400 534 (Bad Request), and indicate the ACME error code 535 "urn:ietf:params:acme:error:badNonce". An error response with the 536 "badNonce" error code MUST include a Replay-Nonce header with a fresh 537 nonce. On receiving such a response, a client SHOULD retry the 538 request using the new nonce. 540 The precise method used to generate and track nonces is up to the 541 server. For example, the server could generate a random 128-bit 542 value for each response, keep a list of issued nonces, and strike 543 nonces from this list as they are used. 545 5.5.1. Replay-Nonce 547 The "Replay-Nonce" header field includes a server-generated value 548 that the server can use to detect unauthorized replay in future 549 client requests. The server should generate the value provided in 550 Replay-Nonce in such a way that they are unique to each message, with 551 high probability. 553 The value of the Replay-Nonce field MUST be an octet string encoded 554 according to the base64url encoding described in Section 2 of 555 [RFC7515]. Clients MUST ignore invalid Replay-Nonce values. 557 base64url = [A-Z] / [a-z] / [0-9] / "-" / "_" 559 Replay-Nonce = *base64url 561 The Replay-Nonce header field SHOULD NOT be included in HTTP request 562 messages. 564 5.5.2. "nonce" (Nonce) JWS header parameter 566 The "nonce" header parameter provides a unique value that enables the 567 verifier of a JWS to recognize when replay has occurred. The "nonce" 568 header parameter MUST be carried in the protected header of the JWS. 570 The value of the "nonce" header parameter MUST be an octet string, 571 encoded according to the base64url encoding described in Section 2 of 572 [RFC7515]. If the value of a "nonce" header parameter is not valid 573 according to this encoding, then the verifier MUST reject the JWS as 574 malformed. 576 5.6. Rate limits 578 Creation of resources can be rate limited to ensure fair usage and 579 prevent abuse. Once the rate limit is exceeded, the server MUST 580 respond with an error with the code "rateLimited". Additionally, the 581 server SHOULD send a "Retry-After" header indicating when the current 582 request may succeed again. If multiple rate limits are in place, 583 that is the time where all rate limits allow access again for the 584 current request with exactly the same parameters. 586 In addition to the human readable "detail" field of the error 587 response, the server MAY send one or multiple tokens in the "Link" 588 header pointing to documentation about the specific hit rate limits 589 using the "rate-limit" relation. 591 5.7. Errors 593 Errors can be reported in ACME both at the HTTP layer and within ACME 594 payloads. ACME servers can return responses with an HTTP error 595 response code (4XX or 5XX). For example: If the client submits a 596 request using a method not allowed in this document, then the server 597 MAY return status code 405 (Method Not Allowed). 599 When the server responds with an error status, it SHOULD provide 600 additional information using problem document [RFC7807]. To 601 facilitate automatic response to errors, this document defines the 602 following standard tokens for use in the "type" field (within the 603 "urn:ietf:params:acme:error:" namespace): 605 +-----------------------+-------------------------------------------+ 606 | Code | Description | 607 +-----------------------+-------------------------------------------+ 608 | badCSR | The CSR is unacceptable (e.g., due to a | 609 | | short key) | 610 | | | 611 | badNonce | The client sent an unacceptable anti- | 612 | | replay nonce | 613 | | | 614 | connection | The server could not connect to | 615 | | validation target | 616 | | | 617 | dnssec | DNSSEC validation failed | 618 | | | 619 | caa | CAA records forbid the CA from issuing | 620 | | | 621 | malformed | The request message was malformed | 622 | | | 623 | serverInternal | The server experienced an internal error | 624 | | | 625 | tls | The server received a TLS error during | 626 | | validation | 627 | | | 628 | unauthorized | The client lacks sufficient authorization | 629 | | | 630 | unknownHost | The server could not resolve a domain | 631 | | name | 632 | | | 633 | rateLimited | The request exceeds a rate limit | 634 | | | 635 | invalidContact | The contact URI for a registration was | 636 | | invalid | 637 | | | 638 | rejectedIdentifier | The server will not issue for the | 639 | | identifier | 640 | | | 641 | unsupportedIdentifier | Identifier is not supported, but may be | 642 | | in future | 643 | | | 644 | agreementRequired | The client must agree to terms before | 645 | | proceeding | 646 +-----------------------+-------------------------------------------+ 648 This list is not exhaustive. The server MAY return errors whose 649 "type" field is set to a URI other than those defined above. Servers 650 MUST NOT use the ACME URN namespace for errors other than the 651 standard types. Clients SHOULD display the "detail" field of such 652 errors. 654 Authorization and challenge objects can also contain error 655 information to indicate why the server was unable to validate 656 authorization. 658 6. Certificate Management 660 In this section, we describe the certificate management functions 661 that ACME enables: 663 o Account Key Registration 665 o Application for a Certificate 667 o Account Key Authorization 669 o Certificate Issuance 671 o Certificate Revocation 673 6.1. Resources 675 ACME is structured as a REST application with a few types of 676 resources: 678 o Registration resources, representing information about an account 680 o Application resources, representing an account's requests to issue 681 certificates 683 o Authorization resources, representing an account's authorization 684 to act for an identifier 686 o Challenge resources, representing a challenge to prove control of 687 an identifier 689 o Certificate resources, representing issued certificates 691 o A "directory" resource 693 o A "new-nonce" resource 695 o A "new-registration" resource 697 o A "new-application" resource 699 o A "revoke-certificate" resource 701 o A "key-change" resource 702 The server MUST provide "directory" and "new-nonce" resources. 704 For the singular resources above ("directory", "new-nonce", "new- 705 registration", "new-application", "revoke-certificate", and "key- 706 change") the resource may be addressed by multiple URIs, but all must 707 provide equivalent functionality. 709 ACME uses different URIs for different management functions. Each 710 function is listed in a directory along with its corresponding URI, 711 so clients only need to be configured with the directory URI. These 712 URIs are connected by a few different link relations [RFC5988]. 714 The "up" link relation is used with challenge resources to indicate 715 the authorization resource to which a challenge belongs. It is also 716 used from certificate resources to indicate a resource from which the 717 client may fetch a chain of CA certificates that could be used to 718 validate the certificate in the original resource. 720 The "directory" link relation is present on all resources other than 721 the directory and indicates the directory URL. 723 The following diagram illustrates the relations between resources on 724 an ACME server. For the most part, these relations are expressed by 725 URLs provided as strings in the resources' JSON representations. 726 Lines with labels in quotes indicate HTTP link relations 728 directory 729 | 730 |--> new-nonce 731 | 732 --------------------------------------------------+ 733 | | | | 734 | | | | 735 V V V V 736 new-reg new-authz new-app revoke-cert 737 | | | ^ 738 | | | | "revoke" 739 V | V | 740 reg | app ---------> cert ---------+ 741 | | ^ | 742 | | | "up" | "up" 743 | V | V 744 +------> authz cert-chain 745 | ^ 746 | | "up" 747 V | 748 challenge 750 The following table illustrates a typical sequence of requests 751 required to establish a new account with the server, prove control of 752 an identifier, issue a certificate, and fetch an updated certificate 753 some time after issuance. The "->" is a mnemonic for a Location 754 header pointing to a created resource. 756 +--------------------+----------------+------------+ 757 | Action | Request | Response | 758 +--------------------+----------------+------------+ 759 | Get a nonce | HEAD new-nonce | 200 | 760 | | | | 761 | Register | POST new-reg | 201 -> reg | 762 | | | | 763 | Apply for a cert | POST new-app | 201 -> app | 764 | | | | 765 | Fetch challenges | GET authz | 200 | 766 | | | | 767 | Answer challenges | POST challenge | 200 | 768 | | | | 769 | Poll for status | GET authz | 200 | 770 | | | | 771 | Request issuance | POST app | 200 | 772 | | | | 773 | Check for new cert | GET cert | 200 | 774 +--------------------+----------------+------------+ 776 The remainder of this section provides the details of how these 777 resources are structured and how the ACME protocol makes use of them. 779 6.1.1. Directory 781 In order to help clients configure themselves with the right URIs for 782 each ACME operation, ACME servers provide a directory object. This 783 should be the only URL needed to configure clients. It is a JSON 784 dictionary, whose keys are drawn from the following table and whose 785 values are the corresponding URLs. 787 +-------------+--------------------+ 788 | Key | URL in value | 789 +-------------+--------------------+ 790 | new-nonce | New nonce | 791 | | | 792 | new-reg | New registration | 793 | | | 794 | new-app | New application | 795 | | | 796 | new-authz | New authorization | 797 | | | 798 | revoke-cert | Revoke certificate | 799 | | | 800 | key-change | Key change | 801 +-------------+--------------------+ 803 There is no constraint on the actual URI of the directory except that 804 it should be different from the other ACME server resources' URIs, 805 and that it should not clash with other services. For instance: 807 o a host which function as both an ACME and Web server may want to 808 keep the root path "/" for an HTML "front page", and and place the 809 ACME directory under path "/acme". 811 o a host which only functions as an ACME server could place the 812 directory under path "/". 814 The dictionary MAY additionally contain a key "meta". If present, it 815 MUST be a JSON dictionary; each item in the dictionary is an item of 816 metadata relating to the service provided by the ACME server. 818 The following metadata items are defined, all of which are OPTIONAL: 820 "terms-of-service" (optional, string): A URI identifying the current 821 terms of service. 823 "website" (optional, string)): An HTTP or HTTPS URL locating a 824 website providing more information about the ACME server. 826 "caa-identities" (optional, array of string): Each string MUST be a 827 lowercase hostname which the ACME server recognises as referring 828 to itself for the purposes of CAA record validation as defined in 829 [RFC6844]. This allows clients to determine the correct issuer 830 domain name to use when configuring CAA record. 832 Clients access the directory by sending a GET request to the 833 directory URI. 835 HTTP/1.1 200 OK 836 Content-Type: application/json 838 { 839 "new-nonce": "https://example.com/acme/new-nonce", 840 "new-reg": "https://example.com/acme/new-reg", 841 "new-app": "https://example.com/acme/new-app", 842 "new-authz": "https://example.com/acme/new-authz", 843 "revoke-cert": "https://example.com/acme/revoke-cert", 844 "key-change": "https://example.com/acme/key-change", 845 "meta": { 846 "terms-of-service": "https://example.com/acme/terms", 847 "website": "https://www.example.com/", 848 "caa-identities": ["example.com"] 849 } 850 } 852 6.1.2. Registration Objects 854 An ACME registration resource represents a set of metadata associated 855 to an account key pair. Registration resources have the following 856 structure: 858 key (required, dictionary): The public key of the account key pair, 859 encoded as a JSON Web Key object [RFC7517]. This field is not 860 updateable by the client. 862 status (required, string): The status of this registration. 863 Possible values are: "valid", "deactivated", and "revoked". 864 "deactivated" should be used to indicate user initiated 865 deactivation whereas "revoked" should be used to indicate 866 administratively initiated deactivation. 868 contact (optional, array of string): An array of URIs that the 869 server can use to contact the client for issues related to this 870 authorization. For example, the server may wish to notify the 871 client about server-initiated revocation. 873 terms-of-service-agreed (optional, boolean): Including this field in 874 a new-registration request, with a value of true, indicates the 875 client's agreement with the terms of service. This field is not 876 updateable by the client. 878 applications (required, string): A URI from which a list of 879 authorizations submitted by this account can be fetched via a GET 880 request. The result of the GET request MUST be a JSON object 881 whose "applications" field is an array of strings, where each 882 string is the URI of an authorization belonging to this 883 registration. The server SHOULD include pending applications, and 884 SHOULD NOT include applications that are invalid. The server MAY 885 return an incomplete list, along with a Link header with link 886 relation "next" indicating a URL to retrieve further entries. 887 This field is not updateable by the client. 889 { 890 "contact": [ 891 "mailto:cert-admin@example.com", 892 "tel:+12025551212" 893 ], 894 "terms-of-service-agreed": true, 895 "applications": "https://example.com/acme/reg/1/apps" 896 } 898 6.1.2.1. Applications List 900 Each registration object includes an applications URI from which a 901 list of applications created by the registration can be fetched via 902 GET request. The result of the GET request MUST be a JSON object 903 whose "applications" field is an array of URIs, each identifying an 904 applications belonging to the registration. The server SHOULD 905 include pending applications, and SHOULD NOT include applications 906 that are invalid in the array of URIs. The server MAY return an 907 incomplete list, along with a Link header with link relation "next" 908 indicating a URL to retrieve further entries. 910 HTTP/1.1 200 OK 911 Content-Type: application/json 912 Link: href="/acme/reg/1/apps?cursor=2", rel="next" 914 { 915 "applications": [ 916 "https://example.com/acme/reg/1/apps/1", 917 "https://example.com/acme/reg/1/apps/2", 918 /* 47 more URLs not shown for example brevity */ 919 "https://example.com/acme/reg/1/apps/50" 920 ] 921 } 923 6.1.3. Application Objects 925 An ACME application object represents a client's request for a 926 certificate, and is used to track the progress of that application 927 through to issuance. Thus, the object contains information about the 928 requested certificate, the server's requirements, and any 929 certificates that have resulted from this application. 931 status (required, string): The status of this application. Possible 932 values are: "pending", "valid", and "invalid". 934 expires (optional, string): The timestamp after which the server 935 will consider this application invalid, encoded in the format 936 specified in RFC 3339 [RFC3339]. This field is REQUIRED for 937 objects with "pending" or "valid" in the status field. 939 csr (required, string): A CSR encoding the parameters for the 940 certificate being requested [RFC2986]. The CSR is sent in the 941 Base64url-encoded version of the DER format. (Note: This field 942 uses the same modified Base64 encoding rules used elsewhere in 943 this document, so it is different from PEM.) 945 notBefore (optional, string): The requested value of the notBefore 946 field in the certificate, in the date format defined in [RFC3339] 948 notAfter (optional, string): The requested value of the notAfter 949 field in the certificate, in the date format defined in [RFC3339] 951 requirements (required, array): The requirements that the client 952 needs to fulfill before the requested certificate can be granted 953 (for pending applications). For final applications, the 954 requirements that were met. Each entry is a dictionary with 955 parameters describing the requirement (see below). 957 certificate (optional, string): A URL for the certificate that has 958 been issued in response to this application. 960 { 961 "status": "pending", 962 "expires": "2015-03-01T14:09:00Z", 964 "csr": "jcRf4uXra7FGYW5ZMewvV...rhlnznwy8YbpMGqwidEXfE", 965 "notBefore": "2016-01-01T00:00:00Z", 966 "notAfter": "2016-01-08T00:00:00Z", 968 "requirements": [ 969 { 970 "type": "authorization", 971 "status": "valid", 972 "url": "https://example.com/acme/authz/1234" 973 }, 974 { 975 "type": "out-of-band", 976 "status": "pending", 977 "url": "https://example.com/acme/payment/1234" 978 } 979 ] 981 "certificate": "https://example.com/acme/cert/1234" 982 } 984 The elements of the "requirements" array are immutable once set, 985 except for their "status" fields. If any other part of the object 986 changes after the object is created, the client MUST consider the 987 application invalid. 989 The "requirements" array in the challenge SHOULD reflect everything 990 that the CA required the client to do before issuance, even if some 991 requirements were fulfilled in earlier applications. For example, if 992 a CA allows multiple applications to be fufilled based on a single 993 authorization transaction, then it must reflect that authorization in 994 all of the applications. 996 Each entry in the "requirements" array expresses a requirement from 997 the CA for the client to take a particular action. All requirements 998 objects have the following basic fields: 1000 type (required, string): The type of requirement (see below for 1001 defined types) 1003 status (required, string): The status of this requirement. Possible 1004 values are: "pending", "valid", and "invalid". 1006 All additional fields are specified by the requirement type. 1008 6.1.3.1. Authorization Requirement 1010 A requirement with type "authorization" requests that the ACME client 1011 complete an authorization transaction. The server specifies the 1012 authorization by pre-provisioning a pending authorization resource 1013 and providing the URI for this resource in the requirement. 1015 url (required, string): The URL for the authorization resource 1017 To fulfill this requirement, the ACME client should fetch the 1018 authorization object from the indicated URL, then follow the process 1019 for obtaining authorization as specified in Section 6.5. 1021 6.1.3.2. Out-of-Band Requirement 1023 A requirement with type "out-of-band" requests that the ACME client 1024 have a human user visit a web page in order to receive further 1025 instructions for how to fulfill the requirement. The requirement 1026 object provides a URI for the web page to be visited. 1028 url (required, string): The URL to be visited. The scheme of this 1029 URL MUST be "http" or "https" 1031 To fulfill this requirement, the ACME client should direct the user 1032 to the indicated web page. 1034 6.1.4. Authorization Objects 1036 An ACME authorization object represents a server's authorization for 1037 an account to represent an identifier. In addition to the 1038 identifier, an authorization includes several metadata fields, such 1039 as the status of the authorization (e.g., "pending", "valid", or 1040 "revoked") and which challenges were used to validate possession of 1041 the identifier. 1043 The structure of an ACME authorization resource is as follows: 1045 identifier (required, dictionary of string): The identifier that the 1046 account is authorized to represent 1048 type (required, string): The type of identifier. 1050 value (required, string): The identifier itself. 1052 status (required, string): The status of this authorization. 1053 Possible values are: "pending", "processing", "valid", "invalid" 1054 and "revoked". If this field is missing, then the default value 1055 is "pending". 1057 expires (optional, string): The timestamp after which the server 1058 will consider this authorization invalid, encoded in the format 1059 specified in RFC 3339 [RFC3339]. This field is REQUIRED for 1060 objects with "valid" in the "status" field. 1062 scope (optional, string): If this field is present, then it MUST 1063 contain a URI for an application resource, such that this 1064 authorization is only valid for that resource. If this field is 1065 absent, then the CA MUST consider this authorization valid for all 1066 applications until the authorization expires. [[ Open issue: More 1067 flexible scoping? ]] 1069 challenges (required, array): The challenges that the client can 1070 fulfill in order to prove possession of the identifier (for 1071 pending authorizations). For final authorizations, the challenges 1072 that were used. Each array entry is a dictionary with parameters 1073 required to validate the challenge, as specified in Section 7. A 1074 client should attempt to fulfill at most one of these challenges, 1075 and a server should consider any one of the challenges sufficient 1076 to make the authorization valid. 1078 The only type of identifier defined by this specification is a fully- 1079 qualified domain name (type: "dns"). The value of the identifier 1080 MUST be the ASCII representation of the domain name. If a domain 1081 name contains Unicode characters it MUST be encoded using the rules 1082 defined in [RFC3492]. Servers MUST verify any identifier values that 1083 begin with the ASCII Compatible Encoding prefix "xn-" as defined in 1084 [RFC5890] are properly encoded. Wildcard domain names (with "*" as 1085 the first label) MUST NOT be included in authorization requests. 1087 { 1088 "status": "valid", 1089 "expires": "2015-03-01T14:09:00Z", 1091 "identifier": { 1092 "type": "dns", 1093 "value": "example.org" 1094 }, 1096 "challenges": [ 1097 { 1098 "type": "http-01", 1099 "status": "valid", 1100 "validated": "2014-12-01T12:05:00Z", 1101 "keyAuthorization": "SXQe-2XODaDxNR...vb29HhjjLPSggwiE" 1102 } 1103 ] 1104 } 1106 6.2. Getting a Nonce 1108 Before sending a POST request to the server, an ACME client needs to 1109 have a fresh anti-replay nonce to put in the "nonce" header of the 1110 JWS. In most cases, the client will have gotten a nonce from a 1111 previous request. However, the client might sometimes need to get a 1112 new nonce, e.g., on its first request to the server or if an existing 1113 nonce is no longer valid. 1115 To get a fresh nonce, the client sends a HEAD request to the new- 1116 nonce resource on the server. The server's response MUST include a 1117 Replay-Nonce header field containing a fresh nonce, and SHOULD have 1118 status code 200 (OK). The server SHOULD also respond to GET requests 1119 for this resource, returning an empty body (while still providing a 1120 Replay-Nonce header). 1122 HEAD /acme/new-nonce HTTP/1.1 1123 Host: example.com 1125 HTTP/1.1 200 OK 1126 Replay-Nonce: oFvnlFP1wIhRlYS2jTaXbA 1127 Cache-Control: no-store 1129 Caching of responses from the new-nonce resource can cause clients to 1130 be unable to communicate with the ACME server. The server MUST 1131 include a Cache-Control header field with the "no-store" directive in 1132 responses for the new-nonce resource, in order to prevent caching of 1133 this resource. 1135 6.3. Registration 1137 A client creates a new account with the server by sending a POST 1138 request to the server's new-registration URI. The body of the 1139 request is a stub registration object containing only the "contact" 1140 field. 1142 POST /acme/new-reg HTTP/1.1 1143 Host: example.com 1144 Content-Type: application/jose+json 1146 { 1147 "protected": base64url({ 1148 "alg": "ES256", 1149 "jwk": {...}, 1150 "nonce": "6S8IqOGY7eL2lsGoTZYifg", 1151 "url": "https://example.com/acme/new-reg" 1152 }) 1153 "payload": base64url({ 1154 "terms-of-service-agreed": true, 1155 "contact": [ 1156 "mailto:cert-admin@example.com", 1157 "tel:+12025551212" 1158 ] 1159 }), 1160 "signature": "RZPOnYoPs1PhjszF...-nh6X1qtOFPB519I" 1161 } 1163 The server MUST ignore any values provided in the "key", and 1164 "applications" fields in registration bodies sent by the client, as 1165 well as any other fields that it does not recognize. If new fields 1166 are specified in the future, the specification of those fields MUST 1167 describe whether they may be provided by the client. 1169 The server SHOULD validate that the contact URLs in the "contact" 1170 field are valid and supported by the server. If the client provides 1171 the server with an invalid or unsupported contact URL, then the 1172 server MUST return an error of type "invalidContact", with a 1173 description describing the error and what types of contact URL the 1174 server considers acceptable. 1176 The server creates a registration object with the included contact 1177 information. The "key" element of the registration is set to the 1178 public key used to verify the JWS (i.e., the "jwk" element of the JWS 1179 header). The server returns this registration object in a 201 1180 (Created) response, with the registration URI in a Location header 1181 field. 1183 If the server already has a registration object with the provided 1184 account key, then it MUST return a 200 (OK) response and provide the 1185 URI of that registration in a Content-Location header field. This 1186 allows a client that has an account key but not the corresponding 1187 registration URI to recover the registration URI. 1189 If the server wishes to present the client with terms under which the 1190 ACME service is to be used, it MUST indicate the URI where such terms 1191 can be accessed in the "terms-of-service" subfield of the "meta" 1192 field in the directory object, and the server MUST reject new- 1193 registration requests that do not have the "terms-of-service-agreed" 1194 set to "true". 1196 HTTP/1.1 201 Created 1197 Content-Type: application/json 1198 Replay-Nonce: D8s4D2mLs8Vn-goWuPQeKA 1199 Location: https://example.com/acme/reg/asdf 1200 Link: ;rel="directory" 1202 { 1203 "key": { /* JWK from JWS header */ }, 1204 "status": "valid", 1206 "contact": [ 1207 "mailto:cert-admin@example.com", 1208 "tel:+12025551212" 1209 ] 1210 } 1212 If the client wishes to update this information in the future, it 1213 sends a POST request with updated information to the registration 1214 URI. The server MUST ignore any updates to the "key", or 1215 "applications" fields or any other fields it does not recognize. The 1216 server MUST verify that the request is signed with the private key 1217 corresponding to the "key" field of the request before updating the 1218 registration. 1220 For example, to update the contact information in the above 1221 registration, the client could send the following request: 1223 POST /acme/reg/asdf HTTP/1.1 1224 Host: example.com 1225 Content-Type: application/jose+json 1227 { 1228 "protected": base64url({ 1229 "alg": "ES256", 1230 "kid": "https://example.com/acme/reg/asdf", 1231 "nonce": "ax5RnthDqp_Yf4_HZnFLmA", 1232 "url": "https://example.com/acme/reg/asdf" 1233 }) 1234 "payload": base64url({ 1235 "contact": [ 1236 "mailto:certificates@example.com", 1237 "tel:+12125551212" 1238 ] 1239 }), 1240 "signature": "hDXzvcj8T6fbFbmn...rDzXzzvzpRy64N0o" 1241 } 1243 Servers SHOULD NOT respond to GET requests for registration resources 1244 as these requests are not authenticated. If a client wishes to query 1245 the server for information about its account (e.g., to examine the 1246 "contact" or "certificates" fields), then it SHOULD do so by sending 1247 a POST request with an empty update. That is, it should send a JWS 1248 whose payload is trivial ({}). 1250 6.3.1. Changes of Terms of Service 1252 As described above, a client can indicate its agreement with the CA's 1253 terms of service by setting the "terms-of-service-agreed" field in 1254 its registration object to "true". 1256 If the server has changed its terms of service since a client 1257 initially agreed, and the server is unwilling to process a request 1258 without explicit agreement to the new terms, then it MUST return an 1259 error response with status code 403 (Forbidden) and type 1260 "urn:ietf:params:acme:error:agreementRequired". This response MUST 1261 include a Link header with link relation "terms-of-service" and the 1262 latest terms-of-service URL. 1264 The problem document returned with the error MUST also include an 1265 "instance" field, indicating a URL that the client should direct a 1266 human user to visit in order for instructions on how to agree to the 1267 terms. 1269 HTTP/1.1 403 Forbidden 1270 Replay-Nonce: IXVHDyxIRGcTE0VSblhPzw 1271 Content-Type: application/problem+json 1272 Content-Language: en 1274 { 1275 "type": "urn:ietf:params:acme:error:agreementRequired" 1276 "detail": "Terms of service have changed" 1277 "instance": "http://example.com/agreement/?token=W8Ih3PswD-8" 1278 } 1280 6.3.2. Account Key Roll-over 1282 A client may wish to change the public key that is associated with a 1283 registration in order to recover from a key compromise or proactively 1284 mitigate the impact of an unnoticed key compromise. 1286 To change the key associated with an account, the client first 1287 constructs a key-change object describing the change that it would 1288 like the server to make: 1290 account (required, string): The URL for account being modified. The 1291 content of this field MUST be the exact string provided in the 1292 Location header field in response to the new-registration request 1293 that created the account. 1295 newKey (required, JWK): The JWK representation of the new key 1297 The client then encapsulates the key-change object in a JWS, signed 1298 with the requested new account key (i.e., the key matching the 1299 "newKey" value). 1301 The outer JWS MUST meet the normal requirements for an ACME JWS (see 1302 Section 5.2). The inner JWS MUST meet the normal requirements, with 1303 the following exceptions: 1305 o The inner JWS MUST have the same "url" parameter as the outer JWS. 1307 o The inner JWS is NOT REQUIRED to have a "nonce" parameter. The 1308 server MUST ignore any value provided for the "nonce" header 1309 parameter. 1311 This transaction has signatures from both the old and new keys so 1312 that the server can verify that the holders of the two keys both 1313 agree to the change. The signatures are nested to preserve the 1314 property that all signatures on POST messages are signed by exactly 1315 one key. 1317 POST /acme/key-change HTTP/1.1 1318 Host: example.com 1319 Content-Type: application/jose+json 1321 { 1322 "protected": base64url({ 1323 "alg": "ES256", 1324 "jwk": /* old key */, 1325 "nonce": "K60BWPrMQG9SDxBDS_xtSw", 1326 "url": "https://example.com/acme/key-change" 1327 }), 1328 "payload": base64url({ 1329 "protected": base64url({ 1330 "alg": "ES256", 1331 "jwk": /* new key */, 1332 }), 1333 "payload": base64url({ 1334 "account": "https://example.com/acme/reg/asdf", 1335 "newKey": /* new key */ 1336 }) 1337 "signature": "Xe8B94RD30Azj2ea...8BmZIRtcSKPSd8gU" 1338 }), 1339 "signature": "5TWiqIYQfIDfALQv...x9C2mg8JGPxl5bI4" 1340 } 1342 On receiving key-change request, the server MUST perform the 1343 following steps in addition to the typical JWS validation: 1345 1. Validate the POST request belongs to a currently active account, 1346 as described in Message Transport. 1348 2. Check that the payload of the JWS is a well-formed JWS object 1349 (the "inner JWS") 1351 3. Check that the JWS protected header of the inner JWS has a "jwk" 1352 field. 1354 4. Check that the inner JWS verifies using the key in its "jwk" 1355 field 1357 5. Check that the payload of the inner JWS is a well-formed key- 1358 change object (as described above) 1360 6. Check that the "url" parameters of the inner and outer JWSs are 1361 the same 1363 7. Check that the "account" field of the key-change object contains 1364 the URL for the registration matching the old key 1366 8. Check that the "newKey" field of the key-change object contains 1367 the key used to sign the inner JWS. 1369 If all of these checks pass, then the server updates the 1370 corresponding registration by replacing the old account key with the 1371 new public key and returns status code 200. Otherwise, the server 1372 responds with an error status code and a problem document describing 1373 the error. 1375 6.3.3. Account deactivation 1377 A client may deactivate an account by posting a signed update to the 1378 server with a status field of "deactivated." Clients may wish to do 1379 this when the account key is compromised. 1381 POST /acme/reg/asdf HTTP/1.1 1382 Host: example.com 1383 Content-Type: application/jose+json 1385 { 1386 "protected": base64url({ 1387 "alg": "ES256", 1388 "kid": "https://example.com/acme/reg/asdf", 1389 "nonce": "ntuJWWSic4WVNSqeUmshgg", 1390 "url": "https://example.com/acme/reg/asdf" 1391 }) 1392 "payload": base64url({ 1393 "status": "deactivated" 1394 }), 1395 "signature": "earzVLd3m5M4xJzR...bVTqn7R08AKOVf3Y" 1396 } 1398 The server MUST verify that the request is signed by the account key. 1399 If the server accepts the deactivation request, it should reply with 1400 a 200 (OK) status code and the current contents of the registration 1401 object. 1403 Once an account is deactivated, the server MUST NOT accept further 1404 requests authorized by that account's key. It is up to server policy 1405 how long to retain data related to that account, whether to revoke 1406 certificates issued by that account, and whether to send email to 1407 that account's contacts. ACME does not provide a way to reactivate a 1408 deactivated account. 1410 6.4. Applying for Certificate Issuance 1412 The holder of an account key pair may use ACME to submit an 1413 application for a certificate to be issued. The client makes this 1414 request by sending a POST request to the server's new-application 1415 resource. The body of the POST is a JWS object whose JSON payload is 1416 a subset of the application object defined in Section 6.1.3, 1417 containing the fields that describe the certificate to be issued: 1419 csr (required, string): A CSR encoding the parameters for the 1420 certificate being requested [RFC2986]. The CSR is sent in the 1421 Base64url-encoded version of the DER format. (Note: This field 1422 uses the same modified Base64 encoding rules used elsewhere in 1423 this document, so it is different from PEM.) 1425 notBefore (optional, string): The requested value of the notBefore 1426 field in the certificate, in the date format defined in [RFC3339] 1428 notAfter (optional, string): The requested value of the notAfter 1429 field in the certificate, in the date format defined in [RFC3339] 1431 POST /acme/new-app HTTP/1.1 1432 Host: example.com 1433 Content-Type: application/jose+json 1435 { 1436 "protected": base64url({ 1437 "alg": "ES256", 1438 "kid": "https://example.com/acme/reg/asdf", 1439 "nonce": "5XJ1L3lEkMG7tR6pA00clA", 1440 "url": "https://example.com/acme/new-app" 1441 }) 1442 "payload": base64url({ 1443 "csr": "5jNudRx6Ye4HzKEqT5...FS6aKdZeGsysoCo4H9P", 1444 "notBefore": "2016-01-01T00:00:00Z", 1445 "notAfter": "2016-01-08T00:00:00Z" 1446 }), 1447 "signature": "H6ZXtGjTZyUnPeKn...wEA4TklBdh3e454g" 1448 } 1450 The CSR encodes the client's requests with regard to the content of 1451 the certificate to be issued. The CSR MUST indicate the requested 1452 identifiers, either in the commonName portion of the requested 1453 subject name, or in an extensionRequest attribute [RFC2985] 1454 requesting a subjectAltName extension. 1456 The server MUST return an error if it cannot fulfil the request as 1457 specified, and MUST NOT issue a certificate with contents other than 1458 those requested. If the server requires the request to be modified 1459 in a certain way, it should indicate the required changes using an 1460 appropriate error code and description. 1462 If the server is willing to issue the requested certificate, it 1463 responds with a 201 (Created) response. The body of this response is 1464 an application object reflecting the client's request and any 1465 requirements the client must fulfill before the certificate will be 1466 issued. 1468 HTTP/1.1 201 Created 1469 Replay-Nonce: MYAuvOpaoIiywTezizk5vw 1470 Location: https://example.com/acme/app/asdf 1472 { 1473 "status": "pending", 1474 "expires": "2015-03-01T14:09:00Z", 1476 "csr": "jcRf4uXra7FGYW5ZMewvV...rhlnznwy8YbpMGqwidEXfE", 1477 "notBefore": "2016-01-01T00:00:00Z", 1478 "notAfter": "2016-01-08T00:00:00Z", 1480 "requirements": [ 1481 { 1482 "type": "authorization", 1483 "status": "valid", 1484 "url": "https://example.com/acme/authz/1234" 1485 }, 1486 { 1487 "type": "out-of-band", 1488 "status": "pending", 1489 "url": "https://example.com/acme/payment/1234" 1490 } 1491 ] 1492 } 1494 The application object returned by the server represents a promise 1495 that if the client fulfills the server's requirements before the 1496 "expires" time, then the server will issue the requested certificate. 1497 In the application object, any object in the "requirements" array 1498 whose status is "pending" represents an action that the client must 1499 perform before the server will issue the certificate. If the client 1500 fails to complete the required actions before the "expires" time, 1501 then the server SHOULD change the status of the application to 1502 "invalid" and MAY delete the application resource. 1504 The server MUST issue the requested certificate and update the 1505 application resource with a URL for the certificate as soon as the 1506 client has fulfilled the server's requirements. If the client has 1507 already satisfied the server's requirements at the time of this 1508 request (e.g., by obtaining authorization for all of the identifiers 1509 in the certificate in previous transactions), then the server MUST 1510 proactively issue the requested certificate and provide a URL for it 1511 in the "certificate" field of the application. The server MUST, 1512 however, still list the satisfied requirements in the "requirements" 1513 array, with the state "valid". 1515 Once the client believes it has fulfilled the server's requirements, 1516 it should send a GET request to the application resource to obtain 1517 its current state. The status of the application will indicate what 1518 action the client should take: 1520 o "invalid": The certificate will not be issued. Consider this 1521 application process abandoned. 1523 o "pending": The server does not believe that the client has 1524 fulfilled the requirements. Check the "requirements" array for 1525 requirements that are still pending. 1527 o "processing": The server agrees that the requirements have been 1528 fulfilled, and is in the process of generating the certificate. 1529 Retry after the time given in the "Retry-After" header field of 1530 the response, if any. 1532 o "valid": The server has issued the certificate and provisioned its 1533 URL to the "certificate" field of the application. Download the 1534 certificate. 1536 6.4.1. Pre-Authorization 1538 The application process described above presumes that authorization 1539 objects are created reactively, in response to an application for 1540 issuance. Some servers may also wish to enable clients to obtain 1541 authorization for an identifier proactively, outside of the context 1542 of a specific issuance. For example, a client hosting virtual 1543 servers for a collection of names might wish to obtain authorization 1544 before any servers are created, and only create a certificate when a 1545 server starts up. 1547 In some cases, a CA running an ACME server might have a completely 1548 external, non-ACME process for authorizing a client to issue for an 1549 identifier. In these case, the CA should provision its ACME server 1550 with authorization objects corresponding to thsee authorizations and 1551 reflect them as alread-valid requirements in any issuance 1552 applications requested by the client. 1554 If a CA wishes to allow pre-authorization within ACME, it can offer a 1555 "new authorization" resource in its directory by adding the key "new- 1556 authz" with a URL for the new authorization resource. 1558 To request authorization for an identifier, the client sends a POST 1559 request to the new-authorization resource specifying the identifier 1560 for which authorization is being requested and how the server should 1561 behave with respect to existing authorizations for this identifier. 1563 identifier (required, dictionary of string): The identifier that the 1564 account is authorized to represent 1566 type (required, string): The type of identifier. 1568 value (required, string): The identifier itself. 1570 existing (optional, string): How an existing authorization should be 1571 handled. Possible values are "accept" and "require". 1573 POST /acme/new-authz HTTP/1.1 1574 Host: example.com 1575 Content-Type: application/jose+json 1577 { 1578 "protected": base64url({ 1579 "alg": "ES256", 1580 "jwk": {...}, 1581 "nonce": "uQpSjlRb4vQVCjVYAyyUWg", 1582 "url": "https://example.com/acme/new-authz" 1583 }) 1584 "payload": base64url({ 1585 "identifier": { 1586 "type": "dns", 1587 "value": "example.net" 1588 }, 1589 "existing": "accept" 1590 }), 1591 "signature": "nuSDISbWG8mMgE7H...QyVUL68yzf3Zawps" 1592 } 1594 Before processing the authorization request, the server SHOULD 1595 determine whether it is willing to issue certificates for the 1596 identifier. For example, the server should check that the identifier 1597 is of a supported type. Servers might also check names against a 1598 blacklist of known high-value identifiers. If the server is 1599 unwilling to issue for the identifier, it SHOULD return a 403 1600 (Forbidden) error, with a problem document describing the reason for 1601 the rejection. 1603 If the authorization request specifies "existing" with a value of 1604 "accept" or "require", before proceeding, the server SHOULD determine 1605 whether there are any existing, valid authorization resources for the 1606 account and given identifier. If one or more such authorizations 1607 exists, a response SHOULD returned with status code 303 (See Other) 1608 and a Location header pointing to the existing resource URL; 1609 processing of the request then stops. If there are multiple such 1610 authorizations, the authorization with the latest expiry date SHOULD 1611 be returned. If no existing authorizations were found and the value 1612 for "existing" was "require", then the server MUST return status code 1613 404 (Not Found); if it was "accept" or was any other value or was 1614 absent, processing continues as follows. 1616 If the server is willing to proceed, it builds a pending 1617 authorization object from the inputs submitted by the client. 1619 o "identifier" the identifier submitted by the client 1621 o "status": MUST be "pending" unless the server has out-of-band 1622 information about the client's authorization status 1624 o "challenges" and "combinations": As selected by the server's 1625 policy for this identifier 1627 The server allocates a new URI for this authorization, and returns a 1628 201 (Created) response, with the authorization URI in a Location 1629 header field, and the JSON authorization object in the body. The 1630 client then follows the process described in Section 6.5 to complete 1631 the authorization process. 1633 6.4.2. Downloading the Certificate 1635 To download the issued certificate, the client simply sends a GET 1636 request to the certificate URL. 1638 The default format of the certificate is PEM (application/x-pem-file) 1639 as specified by [RFC7468]. This format should contain the end-entity 1640 certificate first, followed by any intermediate certificates that are 1641 needed to build a path to a trusted root. Servers SHOULD NOT include 1642 self-signed trust anchors. The client may request other formats by 1643 including an Accept header in its request. For example, the client 1644 may use the media type application/pkix-cert to request the end- 1645 entity certificate in DER format. 1647 The server MAY provide one or more link relation header fields 1648 [RFC5988] with relation "alternate". Each such field should express 1649 an alternative certificate chain starting with the same end-entity 1650 certificate. This can be used to express paths to various trust 1651 anchors. Clients can fetch these alternates and use their own 1652 heuristics to decide which is optimal. 1654 The server MUST also provide a link relation header field with 1655 relation "author" to indicate the application under which this 1656 certificate was issued. 1658 If the CA participates in Certificate Transparency (CT) [RFC6962], 1659 then they may want to provide the client with a Signed Certificate 1660 Timestamp (SCT) that can be used to prove that a certificate was 1661 submitted to a CT log. An SCT can be included as an extension in the 1662 certificate or as an extension to OCSP responses for the certificate. 1663 The server can also provide the client with direct access to an SCT 1664 for a certificate using a Link relation header field with relation 1665 "ct-sct". 1667 GET /acme/cert/asdf HTTP/1.1 1668 Host: example.com 1669 Accept: application/pkix-cert 1671 HTTP/1.1 200 OK 1672 Content-Type: application/pkix-cert 1673 Link: ;rel="up";title="issuer" 1674 Link: ;rel="revoke" 1675 Link: ;rel="author" 1676 Link: ;rel="ct-sct" 1677 Link: ;rel="directory" 1679 -----BEGIN CERTIFICATE----- 1680 [End-entity certificate contents] 1681 -----END CERTIFICATE----- 1682 -----BEGIN CERTIFICATE----- 1683 [Issuer certificate contents] 1684 -----END CERTIFICATE----- 1685 -----BEGIN CERTIFICATE----- 1686 [Other certificate contents] 1687 -----END CERTIFICATE----- 1689 A certificate resource represents a single, immutable certificate. 1690 If the client wishes to obtain a renewed certificate, the client 1691 initiates a new application process to request one. 1693 Because certificate resources are immutable once issuance is 1694 complete, the server MAY enable the caching of the resource by adding 1695 Expires and Cache-Control headers specifying a point in time in the 1696 distant future. These headers have no relation to the certificate's 1697 period of validity. 1699 6.5. Identifier Authorization 1701 The identifier authorization process establishes the authorization of 1702 an account to manage certificates for a given identifier. This 1703 process must assure the server of two things: First, that the client 1704 controls the private key of the account key pair, and second, that 1705 the client holds the identifier in question. This process may be 1706 repeated to associate multiple identifiers to a key pair (e.g., to 1707 request certificates with multiple identifiers), or to associate 1708 multiple accounts with an identifier (e.g., to allow multiple 1709 entities to manage certificates). The server may declare that an 1710 authorization is only valid for a specific application by setting the 1711 "scope" field of the authorization to the URI for that application. 1713 Authorization resources are created by the server in response to 1714 certificate applications or authorization requests submitted by an 1715 account key holder; their URLs are provided to the client in the 1716 responses to these requests. The authorization object is implicitly 1717 tied to the account key used to sign the request. 1719 When a client receives an application from the server with an 1720 "authorization" requirement, it downloads the authorization resource 1721 by sending a GET request to the indicated URL. If the client 1722 initiates authorization using a request to the new authorization 1723 resource, it will have already recevied the pending authorization 1724 object in the response to that request. 1726 GET /acme/authz/1234 HTTP/1.1 1727 Host: example.com 1729 HTTP/1.1 200 OK 1730 Content-Type: application/json 1731 Link: ;rel="directory" 1733 { 1734 "status": "pending", 1736 "identifier": { 1737 "type": "dns", 1738 "value": "example.org" 1739 }, 1741 "challenges": [ 1742 { 1743 "type": "http-01", 1744 "url": "https://example.com/authz/asdf/0", 1745 "token": "IlirfxKKXAsHtmzK29Pj8A" 1746 }, 1747 { 1748 "type": "dns-01", 1749 "url": "https://example.com/authz/asdf/1", 1750 "token": "DGyRejmCefe7v4NfDGDKfA" 1751 } 1752 ], 1753 } 1755 6.5.1. Responding to Challenges 1757 To prove control of the identifier and receive authorization, the 1758 client needs to respond with information to complete the challenges. 1759 To do this, the client updates the authorization object received from 1760 the server by filling in any required information in the elements of 1761 the "challenges" dictionary. (This is also the stage where the 1762 client should perform any actions required by the challenge.) 1764 The client sends these updates back to the server in the form of a 1765 JSON object with the response fields required by the challenge type, 1766 carried in a POST request to the challenge URI (not authorization 1767 URI). This allows the client to send information only for challenges 1768 it is responding to. 1770 For example, if the client were to respond to the "http-01" challenge 1771 in the above authorization, it would send the following request: 1773 POST /acme/authz/asdf/0 HTTP/1.1 1774 Host: example.com 1775 Content-Type: application/jose+json 1777 { 1778 "protected": base64url({ 1779 "alg": "ES256", 1780 "kid": "https://example.com/acme/reg/asdf", 1781 "nonce": "Q_s3MWoqT05TrdkM2MTDcw", 1782 "url": "https://example.com/acme/authz/asdf/0" 1783 }) 1784 "payload": base64url({ 1785 "type": "http-01", 1786 "keyAuthorization": "IlirfxKKXA...vb29HhjjLPSggwiE" 1787 }), 1788 "signature": "9cbg5JO1Gf5YLjjz...SpkUfcdPai9uVYYQ" 1789 } 1791 The server updates the authorization document by updating its 1792 representation of the challenge with the response fields provided by 1793 the client. The server MUST ignore any fields in the response object 1794 that are not specified as response fields for this type of challenge. 1795 The server provides a 200 (OK) response with the updated challenge 1796 object as its body. 1798 If the client's response is invalid for some reason, or does not 1799 provide the server with appropriate information to validate the 1800 challenge, then the server MUST return an HTTP error. On receiving 1801 such an error, the client SHOULD undo any actions that have been 1802 taken to fulfill the challenge, e.g., removing files that have been 1803 provisioned to a web server. 1805 The server is said to "finalize" the authorization when it has 1806 completed one of the validations, by assigning the authorization a 1807 status of "valid" or "invalid", corresponding to whether it considers 1808 the account authorized for the identifier. If the final state is 1809 "valid", the server MUST add an "expires" field to the authorization. 1810 When finalizing an authorization, the server MAY remove challenges 1811 other than the one that was completed. The server SHOULD NOT remove 1812 challenges with status "invalid". 1814 Usually, the validation process will take some time, so the client 1815 will need to poll the authorization resource to see when it is 1816 finalized. For challenges where the client can tell when the server 1817 has validated the challenge (e.g., by seeing an HTTP or DNS request 1818 from the server), the client SHOULD NOT begin polling until it has 1819 seen the validation request from the server. 1821 To check on the status of an authorization, the client sends a GET 1822 request to the authorization URI, and the server responds with the 1823 current authorization object. In responding to poll requests while 1824 the validation is still in progress, the server MUST return a 202 1825 (Accepted) response, and MAY include a Retry-After header field to 1826 suggest a polling interval to the client. 1828 GET /acme/authz/asdf HTTP/1.1 1829 Host: example.com 1831 HTTP/1.1 200 OK 1833 { 1834 "status": "valid", 1835 "expires": "2015-03-01T14:09:00Z", 1837 "identifier": { 1838 "type": "dns", 1839 "value": "example.org" 1840 }, 1842 "challenges": [ 1843 { 1844 "type": "http-01" 1845 "status": "valid", 1846 "validated": "2014-12-01T12:05:00Z", 1847 "token": "IlirfxKKXAsHtmzK29Pj8A", 1848 "keyAuthorization": "IlirfxKKXA...vb29HhjjLPSggwiE" 1849 } 1850 ] 1851 } 1853 6.5.2. Deactivating an Authorization 1855 If a client wishes to relinquish its authorization to issue 1856 certificates for an identifier, then it may request that the server 1857 deactivate each authorization associated with that identifier by 1858 sending a POST request with the static object {"status": 1859 "deactivated"}. 1861 POST /acme/authz/asdf HTTP/1.1 1862 Host: example.com 1863 Content-Type: application/jose+json 1865 { 1866 "protected": base64url({ 1867 "alg": "ES256", 1868 "kid": "https://example.com/acme/reg/asdf", 1869 "nonce": "xWCM9lGbIyCgue8di6ueWQ", 1870 "url": "https://example.com/acme/authz/asdf" 1871 }) 1872 "payload": base64url({ 1873 "status": "deactivated" 1874 }), 1875 "signature": "srX9Ji7Le9bjszhu...WTFdtujObzMtZcx4" 1876 } 1878 The server MUST verify that the request is signed by the account key 1879 corresponding to the account that owns the authorization. If the 1880 server accepts the deactivation, it should reply with a 200 (OK) 1881 status code and the current contents of the authorization object. 1883 The server MUST NOT treat deactivated authorization objects as 1884 sufficient for issuing certificates. 1886 6.6. Certificate Revocation 1888 To request that a certificate be revoked, the client sends a POST 1889 request to the ACME server's revoke-cert URI. The body of the POST 1890 is a JWS object whose JSON payload contains the certificate to be 1891 revoked: 1893 certificate (required, string): The certificate to be revoked, in 1894 the base64url-encoded version of the DER format. (Note: This 1895 field uses the same modified Base64 encoding rules used elsewhere 1896 in this document, so it is different from PEM.) 1898 reason (optional, int): One of the revocation reasonCodes defined in 1899 RFC 5280 [RFC5280] Section 5.3.1 to be used when generating OCSP 1900 responses and CRLs. If this field is not set the server SHOULD 1901 use the unspecified (0) reasonCode value when generating OCSP 1902 responses and CRLs. The server MAY disallow a subset of 1903 reasonCodes from being used by the user. 1905 POST /acme/revoke-cert HTTP/1.1 1906 Host: example.com 1907 Content-Type: application/jose+json 1909 { 1910 "protected": base64url({ 1911 "alg": "ES256", 1912 "kid": "https://example.com/acme/reg/asdf", // OR "jwk" 1913 "nonce": "JHb54aT_KTXBWQOzGYkt9A", 1914 "url": "https://example.com/acme/revoke-cert" 1915 }) 1916 "payload": base64url({ 1917 "certificate": "MIIEDTCCAvegAwIBAgIRAP8...", 1918 "reason": 1 1919 }), 1920 "signature": "Q1bURgJoEslbD1c5...3pYdSMLio57mQNN4" 1921 } 1923 Revocation requests are different from other ACME request in that 1924 they can be signed either with an account key pair or the key pair in 1925 the certificate. Before revoking a certificate, the server MUST 1926 verify that the key used to sign the request is authorized to revoke 1927 the certificate. The server SHOULD consider at least the following 1928 keys authorized for a given certificate: 1930 o the public key in the certificate. 1932 o an account key that is authorized to act for all of the 1933 identifier(s) in the certificate. 1935 If the revocation succeeds, the server responds with status code 200 1936 (OK). If the revocation fails, the server returns an error. 1938 HTTP/1.1 200 OK 1939 Replay-Nonce: IXVHDyxIRGcTE0VSblhPzw 1940 Content-Length: 0 1942 --- or --- 1944 HTTP/1.1 403 Forbidden 1945 Replay-Nonce: IXVHDyxIRGcTE0VSblhPzw 1946 Content-Type: application/problem+json 1947 Content-Language: en 1949 { 1950 "type": "urn:ietf:params:acme:error:unauthorized" 1951 "detail": "No authorization provided for name example.net" 1952 "instance": "http://example.com/doc/unauthorized" 1953 } 1955 7. Identifier Validation Challenges 1957 There are few types of identifiers in the world for which there is a 1958 standardized mechanism to prove possession of a given identifier. In 1959 all practical cases, CAs rely on a variety of means to test whether 1960 an entity applying for a certificate with a given identifier actually 1961 controls that identifier. 1963 Challenges provide the server with assurance that an account key 1964 holder is also the entity that controls an identifier. For each type 1965 of challenge, it must be the case that in order for an entity to 1966 successfully complete the challenge the entity must both: 1968 o Hold the private key of the account key pair used to respond to 1969 the challenge 1971 o Control the identifier in question 1973 Section 9 documents how the challenges defined in this document meet 1974 these requirements. New challenges will need to document how they 1975 do. 1977 ACME uses an extensible challenge/response framework for identifier 1978 validation. The server presents a set of challenges in the 1979 authorization object it sends to a client (as objects in the 1980 "challenges" array), and the client responds by sending a response 1981 object in a POST request to a challenge URI. 1983 This section describes an initial set of challenge types. Each 1984 challenge must describe: 1986 1. Content of challenge objects 1988 2. Content of response objects 1990 3. How the server uses the challenge and response to verify control 1991 of an identifier 1993 Challenge objects all contain the following basic fields: 1995 type (required, string): The type of challenge encoded in the 1996 object. 1998 url (required, string): The URL to which a response can be posted. 2000 status (required, string): The status of this authorization. 2001 Possible values are: "pending", "valid", and "invalid". 2003 validated (optional, string): The time at which this challenge was 2004 completed by the server, encoded in the format specified in RFC 2005 3339 [RFC3339]. This field is REQUIRED if the "status" field is 2006 "valid". 2008 error (optional, dictionary of string): The error that occurred 2009 while the server was validating the challenge, if any. This field 2010 is structured as a problem document [RFC7807]. 2012 All additional fields are specified by the challenge type. If the 2013 server sets a challenge's "status" to "invalid", it SHOULD also 2014 include the "error" field to help the client diagnose why they failed 2015 the challenge. 2017 Different challenges allow the server to obtain proof of different 2018 aspects of control over an identifier. In some challenges, like HTTP 2019 and TLS SNI, the client directly proves its ability to do certain 2020 things related to the identifier. The choice of which challenges to 2021 offer to a client under which circumstances is a matter of server 2022 policy. 2024 The identifier validation challenges described in this section all 2025 relate to validation of domain names. If ACME is extended in the 2026 future to support other types of identifier, there will need to be 2027 new challenge types, and they will need to specify which types of 2028 identifier they apply to. 2030 [[ Editor's Note: In pre-RFC versions of this specification, 2031 challenges are labeled by type, and with the version of the draft in 2032 which they were introduced. For example, if an HTTP challenge were 2033 introduced in version -03 and a breaking change made in version -05, 2034 then there would be a challenge labeled "http-03" and one labeled 2035 "http-05" - but not one labeled "http-04", since challenge in version 2036 -04 was compatible with one in version -04. ]] 2038 7.1. Key Authorizations 2040 Several of the challenges in this document makes use of a key 2041 authorization string. A key authorization is a string that expresses 2042 a domain holder's authorization for a specified key to satisfy a 2043 specified challenge, by concatenating the token for the challenge 2044 with a key fingerprint, separated by a "." character: 2046 key-authz = token || '.' || base64url(JWK\_Thumbprint(accountKey)) 2048 The "JWK_Thumbprint" step indicates the computation specified in 2049 [RFC7638], using the SHA-256 digest. As specified in the individual 2050 challenges below, the token for a challenge is a JSON string 2051 comprised entirely of characters in the URL-safe Base64 alphabet. 2052 The "||" operator indicates concatenation of strings. 2054 In computations involving key authorizations, such as the digest 2055 computations required for the DNS and TLS SNI challenges, the key 2056 authorization string MUST be represented in UTF-8 form (or, 2057 equivalently, ASCII). 2059 An example of how to compute a JWK thumbprint can be found in 2060 Section 3.1 of [RFC7638]. Note that some cryptographic libraries 2061 prepend a zero octet to the representation of the RSA public key 2062 parameters N and E, in order to avoid ambiguity with regard to the 2063 sign of the number. As noted in JWA [RFC7518], a JWK object MUST NOT 2064 include this zero octet. That is, any initial zero octets MUST be 2065 stripped before the values are base64url-encoded. 2067 7.2. HTTP 2069 With HTTP validation, the client in an ACME transaction proves its 2070 control over a domain name by proving that it can provision resources 2071 on an HTTP server that responds for that domain name. The ACME 2072 server challenges the client to provision a file at a specific path, 2073 with a specific string as its content. 2075 As a domain may resolve to multiple IPv4 and IPv6 addresses, the 2076 server will connect to at least one of the hosts found in A and AAAA 2077 records, at its discretion. Because many webservers allocate a 2078 default HTTPS virtual host to a particular low-privilege tenant user 2079 in a subtle and non-intuitive manner, the challenge must be completed 2080 over HTTP, not HTTPS. 2082 type (required, string): The string "http-01" 2084 token (required, string): A random value that uniquely identifies 2085 the challenge. This value MUST have at least 128 bits of entropy, 2086 in order to prevent an attacker from guessing it. It MUST NOT 2087 contain any characters outside the URL-safe Base64 alphabet and 2088 MUST NOT contain any padding characters ("="). 2090 { 2091 "type": "http-01", 2092 "token": "evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA" 2093 } 2095 A client responds to this challenge by constructing a key 2096 authorization from the "token" value provided in the challenge and 2097 the client's account key. The client then provisions the key 2098 authorization as a resource on the HTTP server for the domain in 2099 question. 2101 The path at which the resource is provisioned is comprised of the 2102 fixed prefix ".well-known/acme-challenge/", followed by the "token" 2103 value in the challenge. The value of the resource MUST be the ASCII 2104 representation of the key authorization. 2106 .well-known/acme-challenge/evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA 2108 The client's response to this challenge indicates its agreement to 2109 this challenge by sending the server the key authorization covering 2110 the challenge's token and the client's account key. 2112 keyAuthorization (required, string): The key authorization for this 2113 challenge. This value MUST match the token from the challenge and 2114 the client's account key. 2116 /* BEGIN JWS-signed content */ 2117 { 2118 "keyAuthorization": "evaGxfADs...62jcerQ" 2119 } 2120 /* END JWS-signed content */ 2122 On receiving a response, the server MUST verify that the key 2123 authorization in the response matches the "token" value in the 2124 challenge and the client's account key. If they do not match, then 2125 the server MUST return an HTTP error in response to the POST request 2126 in which the client sent the challenge. 2128 Given a challenge/response pair, the server verifies the client's 2129 control of the domain by verifying that the resource was provisioned 2130 as expected. 2132 1. Form a URI by populating the URI template [RFC6570] 2133 "http://{domain}/.well-known/acme-challenge/{token}", where: 2135 * the domain field is set to the domain name being verified; and 2137 * the token field is set to the token in the challenge. 2139 2. Verify that the resulting URI is well-formed. 2141 3. Dereference the URI using an HTTP GET request. This request MUST 2142 be sent to TCP port 80 on the server. 2144 4. Verify that the body of the response is well-formed key 2145 authorization. The server SHOULD ignore whitespace characters at 2146 the end of the body. 2148 5. Verify that key authorization provided by the server matches the 2149 token for this challenge and the client's account key. 2151 If all of the above verifications succeed, then the validation is 2152 successful. If the request fails, or the body does not pass these 2153 checks, then it has failed. 2155 7.3. TLS with Server Name Indication (TLS SNI) 2157 The TLS with Server Name Indication (TLS SNI) validation method 2158 proves control over a domain name by requiring the client to 2159 configure a TLS server referenced by an A/AAAA record under the 2160 domain name to respond to specific connection attempts utilizing the 2161 Server Name Indication extension [RFC6066]. The server verifies the 2162 client's challenge by accessing the reconfigured server and verifying 2163 a particular challenge certificate is presented. 2165 type (required, string): The string "tls-sni-02" 2167 token (required, string): A random value that uniquely identifies 2168 the challenge. This value MUST have at least 128 bits of entropy, 2169 in order to prevent an attacker from guessing it. It MUST NOT 2170 contain any characters outside the URL-safe Base64 alphabet and 2171 MUST NOT contain any padding characters ("="). 2173 { 2174 "type": "tls-sni-02", 2175 "token": "evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA" 2176 } 2178 A client responds to this challenge by constructing a self-signed 2179 certificate which the client MUST provision at the domain name 2180 concerned in order to pass the challenge. 2182 The certificate may be constructed arbitrarily, except that each 2183 certificate MUST have exactly two subjectAlternativeNames, SAN A and 2184 SAN B. Both MUST be dNSNames. 2186 SAN A MUST be constructed as follows: compute the SHA-256 digest of 2187 the UTF-8-encoded challenge token and encode it in lowercase 2188 hexadecimal form. The dNSName is "x.y.token.acme.invalid", where x 2189 is the first half of the hexadecimal representation and y is the 2190 second half. 2192 SAN B MUST be constructed as follows: compute the SHA-256 digest of 2193 the UTF-8 encoded key authorization and encode it in lowercase 2194 hexadecimal form. The dNSName is "x.y.ka.acme.invalid" where x is 2195 the first half of the hexadecimal representation and y is the second 2196 half. 2198 The client MUST ensure that the certificate is served to TLS 2199 connections specifying a Server Name Indication (SNI) value of SAN A. 2201 The response to the TLS-SNI challenge simply acknowledges that the 2202 client is ready to fulfill this challenge. 2204 keyAuthorization (required, string): The key authorization for this 2205 challenge. This value MUST match the token from the challenge and 2206 the client's account key. 2208 /* BEGIN JWS-signed content */ 2209 { 2210 "keyAuthorization": "evaGxfADs...62jcerQ" 2211 } 2212 /* END JWS-signed content */ 2214 On receiving a response, the server MUST verify that the key 2215 authorization in the response matches the "token" value in the 2216 challenge and the client's account key. If they do not match, then 2217 the server MUST return an HTTP error in response to the POST request 2218 in which the client sent the challenge. 2220 Given a challenge/response pair, the ACME server verifies the 2221 client's control of the domain by verifying that the TLS server was 2222 configured appropriately, using these steps: 2224 1. Compute SAN A and SAN B in the same way as the client. 2226 2. Open a TLS connection to the domain name being validated, 2227 presenting SAN A in the SNI field. This connection MUST be sent 2228 to TCP port 443 on the server. In the ClientHello initiating the 2229 TLS handshake, the server MUST include a server_name extension 2230 (i.e., SNI) containing SAN A. The server SHOULD ensure that it 2231 does not reveal SAN B in any way when making the TLS connection, 2232 such that the presentation of SAN B in the returned certificate 2233 proves association with the client. 2235 3. Verify that the certificate contains a subjectAltName extension 2236 containing dNSName entries of SAN A and SAN B and no other 2237 entries. The comparison MUST be insensitive to case and ordering 2238 of names. 2240 It is RECOMMENDED that the ACME server validation TLS connections 2241 from multiple vantage points to reduce the risk of DNS hijacking 2242 attacks. 2244 If all of the above verifications succeed, then the validation is 2245 successful. Otherwise, the validation fails. 2247 7.4. DNS 2249 When the identifier being validated is a domain name, the client can 2250 prove control of that domain by provisioning a resource record under 2251 it. The DNS challenge requires the client to provision a TXT record 2252 containing a designated value under a specific validation domain 2253 name. 2255 type (required, string): The string "dns-01" 2257 token (required, string): A random value that uniquely identifies 2258 the challenge. This value MUST have at least 128 bits of entropy, 2259 in order to prevent an attacker from guessing it. It MUST NOT 2260 contain any characters outside the URL-safe Base64 alphabet and 2261 MUST NOT contain any padding characters ("="). 2263 { 2264 "type": "dns-01", 2265 "token": "evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA" 2266 } 2267 A client responds to this challenge by constructing a key 2268 authorization from the "token" value provided in the challenge and 2269 the client's account key. The client then computes the SHA-256 2270 digest of the key authorization. 2272 The record provisioned to the DNS is the base64url encoding of this 2273 digest. The client constructs the validation domain name by 2274 prepending the label "_acme-challenge" to the domain name being 2275 validated, then provisions a TXT record with the digest value under 2276 that name. For example, if the domain name being validated is 2277 "example.com", then the client would provision the following DNS 2278 record: 2280 _acme-challenge.example.com. 300 IN TXT "gfj9Xq...Rg85nM" 2282 The response to the DNS challenge provides the computed key 2283 authorization to acknowledge that the client is ready to fulfill this 2284 challenge. 2286 keyAuthorization (required, string): The key authorization for this 2287 challenge. This value MUST match the token from the challenge and 2288 the client's account key. 2290 /* BEGIN JWS-signed content */ 2291 { 2292 "keyAuthorization": "evaGxfADs...62jcerQ" 2293 } 2294 /* END JWS-signed content */ 2296 On receiving a response, the server MUST verify that the key 2297 authorization in the response matches the "token" value in the 2298 challenge and the client's account key. If they do not match, then 2299 the server MUST return an HTTP error in response to the POST request 2300 in which the client sent the challenge. 2302 To validate a DNS challenge, the server performs the following steps: 2304 1. Compute the SHA-256 digest of the key authorization 2306 2. Query for TXT records under the validation domain name 2308 3. Verify that the contents of one of the TXT records matches the 2309 digest value 2311 If all of the above verifications succeed, then the validation is 2312 successful. If no DNS record is found, or DNS record and response 2313 payload do not pass these checks, then the validation fails. 2315 7.5. Out-of-Band 2317 There may be cases where a server cannot perform automated validation 2318 of an identifier, for example if validation requires some manual 2319 steps. In such cases, the server may provide an "out of band" (OOB) 2320 challenge to request that the client perform some action outside of 2321 ACME in order to validate possession of the identifier. 2323 The OOB challenge requests that the client have a human user visit a 2324 web page to receive instructions on how to validate possession of the 2325 identifier, by providing a URL for that web page. 2327 type (required, string): The string "oob-01" 2329 href (required, string): The URL to be visited. The scheme of this 2330 URL MUST be "http" or "https". Note that this field is distinct 2331 from the "url" field of the challenge, which identifies the 2332 challenge itself. 2334 { 2335 "type": "oob-01", 2336 "href": "https://example.com/validate/evaGxfADs6pSRb2LAv9IZ" 2337 } 2339 A client responds to this challenge by presenting the indicated URL 2340 for a human user to navigate to. If the user choses to complete this 2341 challege (by vising the website and completing its instructions), the 2342 client indicates this by sending a simple acknowledgement response to 2343 the server. 2345 type (required, string): The string "oob-01" 2347 /* BEGIN JWS-signed content */ 2348 { 2349 "type": "oob-01" 2350 } 2351 /* END JWS-signed content */ 2353 On receiving a response, the server MUST verify that the value of the 2354 "type" field is as required. Otherwise, the steps the server takes 2355 to validate identifier possession are determined by the server's 2356 local policy. 2358 8. IANA Considerations 2360 [[ Editor's Note: Should we create a registry for tokens that go into 2361 the various JSON objects used by this protocol, i.e., the field names 2362 in the JSON objects? ]] 2364 8.1. Well-Known URI for the HTTP Challenge 2366 The "Well-Known URIs" registry should be updated with the following 2367 additional value (using the template from [RFC5785]): 2369 URI suffix: acme-challenge 2371 Change controller: IETF 2373 Specification document(s): This document, Section Section 7.2 2375 Related information: N/A 2377 8.2. Replay-Nonce HTTP Header 2379 The "Message Headers" registry should be updated with the following 2380 additional value: 2382 | Header Field Name | Protocol | Status | Reference | 2383 +:------------+:------+:------+:-----------+ | Replay-Nonce | http | 2384 standard | Section 5.5.1 | 2386 8.3. "url" JWS Header Parameter 2388 The "JSON Web Signature and Encryption Header Parameters" registry 2389 should be updated with the following additional value: 2391 o Header Parameter Name: "url" 2393 o Header Parameter Description: URL 2395 o Header Parameter Usage Location(s): JWE, JWS 2397 o Change Controller: IESG 2399 o Specification Document(s): Section 5.4.1 of RFC XXXX 2401 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2402 to this document ]] 2404 8.4. "nonce" JWS Header Parameter 2406 The "JSON Web Signature and Encryption Header Parameters" registry 2407 should be updated with the following additional value: 2409 o Header Parameter Name: "nonce" 2411 o Header Parameter Description: Nonce 2412 o Header Parameter Usage Location(s): JWE, JWS 2414 o Change Controller: IESG 2416 o Specification Document(s): Section 5.5.2 of RFC XXXX 2418 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2419 to this document ]] 2421 8.5. URN Sub-namespace for ACME (urn:ietf:params:acme) 2423 The "IETF URN Sub-namespace for Registered Protocol Parameter 2424 Identifiers" registry should be updated with the following additional 2425 value, following the template in [RFC3553]: 2427 Registry name: acme 2429 Specification: RFC XXXX 2431 Repository: URL-TBD 2433 Index value: No transformation needed. The 2435 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2436 to this document, and replace URL-TBD with the URL assigned by IANA 2437 for registries of ACME parameters. ]] 2439 8.6. New Registries 2441 This document requests that IANA create the following new registries: 2443 1. ACME Error Codes 2445 2. ACME Resource Types 2447 3. ACME Identifier Types 2449 4. ACME Challenge Types 2451 All of these registries should be administered under a Specification 2452 Required policy [RFC5226]. 2454 8.6.1. Error Codes 2456 This registry lists values that are used within URN values that are 2457 provided in the "type" field of problem documents in ACME. 2459 Template: 2461 o Code: The label to be included in the URN for this error, 2462 following "urn:ietf:params:acme:" 2464 o Description: A human-readable description of the error 2466 o Reference: Where the error is defined 2468 Initial contents: The codes and descriptions in the table in 2469 Section 5.7 above, with the Reference field set to point to this 2470 specification. 2472 8.6.2. Resource Types 2474 This registry lists the types of resources that ACME servers may list 2475 in their directory objects. 2477 Template: 2479 o Key: The value to be used as a dictionary key in the directory 2480 object 2482 o Resource type: The type of resource labeled by the key 2484 o Reference: Where the identifier type is defined 2486 Initial contents: 2488 +-------------+--------------------+-----------+ 2489 | Key | Resource type | Reference | 2490 +-------------+--------------------+-----------+ 2491 | new-reg | New registration | RFC XXXX | 2492 | | | | 2493 | new-app | New application | RFC XXXX | 2494 | | | | 2495 | revoke-cert | Revoke certificate | RFC XXXX | 2496 | | | | 2497 | key-change | Key change | RFC XXXX | 2498 +-------------+--------------------+-----------+ 2500 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2501 to this document ]] 2503 8.6.3. Identifier Types 2505 This registry lists the types of identifiers that ACME clients may 2506 request authorization to issue in certificates. 2508 Template: 2510 o Label: The value to be put in the "type" field of the identifier 2511 object 2513 o Reference: Where the identifier type is defined 2515 Initial contents: 2517 +-------+-----------+ 2518 | Label | Reference | 2519 +-------+-----------+ 2520 | dns | RFC XXXX | 2521 +-------+-----------+ 2523 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2524 to this document ]] 2526 8.6.4. Challenge Types 2528 This registry lists the ways that ACME servers can offer to validate 2529 control of an identifier. The "Identifier Type" field in template 2530 must be contained in the Label column of the ACME Identifier Types 2531 registry. 2533 Template: 2535 o Label: The value to be put in the "type" field of challenge 2536 objects using this validation mechanism 2538 o Identifier Type: The type of identifier that this mechanism 2539 applies to 2541 o Reference: Where the challenge type is defined 2543 Initial Contents 2545 +---------+-----------------+-----------+ 2546 | Label | Identifier Type | Reference | 2547 +---------+-----------------+-----------+ 2548 | http | dns | RFC XXXX | 2549 | | | | 2550 | tls-sni | dns | RFC XXXX | 2551 | | | | 2552 | dns | dns | RFC XXXX | 2553 +---------+-----------------+-----------+ 2555 [[ RFC EDITOR: Please replace XXXX above with the RFC number assigned 2556 to this document ]] 2558 9. Security Considerations 2560 ACME is a protocol for managing certificates that attest to 2561 identifier/key bindings. Thus the foremost security goal of ACME is 2562 to ensure the integrity of this process, i.e., to ensure that the 2563 bindings attested by certificates are correct, and that only 2564 authorized entities can manage certificates. ACME identifies clients 2565 by their account keys, so this overall goal breaks down into two more 2566 precise goals: 2568 1. Only an entity that controls an identifier can get an account key 2569 authorized for that identifier 2571 2. Once authorized, an account key's authorizations cannot be 2572 improperly transferred to another account key 2574 In this section, we discuss the threat model that underlies ACME and 2575 the ways that ACME achieves these security goals within that threat 2576 model. We also discuss the denial-of-service risks that ACME servers 2577 face, and a few other miscellaneous considerations. 2579 9.1. Threat model 2581 As a service on the Internet, ACME broadly exists within the Internet 2582 threat model [RFC3552]. In analyzing ACME, it is useful to think of 2583 an ACME server interacting with other Internet hosts along two 2584 "channels": 2586 o An ACME channel, over which the ACME HTTPS requests are exchanged 2588 o A validation channel, over which the ACME server performs 2589 additional requests to validate a client's control of an 2590 identifier 2592 +------------+ 2593 | ACME | ACME Channel 2594 | Client |--------------------+ 2595 +------------+ | 2596 V 2597 +------------+ 2598 | ACME | 2599 | Server | 2600 +------------+ 2601 +------------+ | 2602 | Validation |<-------------------+ 2603 | Server | Validation Channel 2604 +------------+ 2605 In practice, the risks to these channels are not entirely separate, 2606 but they are different in most cases. Each channel, for example, 2607 uses a different communications pattern: the ACME channel will 2608 comprise inbound HTTPS connections to the ACME server and the 2609 validation channel outbound HTTP or DNS requests. 2611 Broadly speaking, ACME aims to be secure against active and passive 2612 attackers on any individual channel. Some vulnerabilities arise 2613 (noted below), when an attacker can exploit both the ACME channel and 2614 one of the others. 2616 On the ACME channel, in addition to network-layer attackers, we also 2617 need to account for application-layer man in the middle attacks, and 2618 for abusive use of the protocol itself. Protection against 2619 application-layer MitM addresses potential attackers such as Content 2620 Distribution Networks (CDNs) and middleboxes with a TLS MitM 2621 function. Preventing abusive use of ACME means ensuring that an 2622 attacker with access to the validation channel can't obtain 2623 illegitimate authorization by acting as an ACME client (legitimately, 2624 in terms of the protocol). 2626 9.2. Integrity of Authorizations 2628 ACME allows anyone to request challenges for an identifier by 2629 registering an account key and sending a new-application request 2630 under that account key. The integrity of the authorization process 2631 thus depends on the identifier validation challenges to ensure that 2632 the challenge can only be completed by someone who both (1) holds the 2633 private key of the account key pair, and (2) controls the identifier 2634 in question. 2636 Validation responses need to be bound to an account key pair in order 2637 to avoid situations where an ACME MitM can switch out a legitimate 2638 domain holder's account key for one of his choosing, e.g.: 2640 o Legitimate domain holder registers account key pair A 2642 o MitM registers account key pair B 2644 o Legitimate domain holder sends a new-application request signed 2645 under account key A 2647 o MitM suppresses the legitimate request, but sends the same request 2648 signed under account key B 2650 o ACME server issues challenges and MitM forwards them to the 2651 legitimate domain holder 2653 o Legitimate domain holder provisions the validation response 2655 o ACME server performs validation query and sees the response 2656 provisioned by the legitimate domain holder 2658 o Because the challenges were issued in response to a message signed 2659 account key B, the ACME server grants authorization to account key 2660 B (the MitM) instead of account key A (the legitimate domain 2661 holder) 2663 All of the challenges above have a binding between the account 2664 private key and the validation query made by the server, via the key 2665 authorization. The key authorization is signed by the account 2666 private key, reflects the corresponding public key, and is provided 2667 to the server in the validation response. 2669 The association of challenges to identifiers is typically done by 2670 requiring the client to perform some action that only someone who 2671 effectively controls the identifier can perform. For the challenges 2672 in this document, the actions are: 2674 o HTTP: Provision files under .well-known on a web server for the 2675 domain 2677 o TLS SNI: Configure a TLS server for the domain 2679 o DNS: Provision DNS resource records for the domain 2681 There are several ways that these assumptions can be violated, both 2682 by misconfiguration and by attack. For example, on a web server that 2683 allows non-administrative users to write to .well-known, any user can 2684 claim to own the server's hostname by responding to an HTTP 2685 challenge, and likewise for TLS configuration and TLS SNI. 2687 The use of hosting providers is a particular risk for ACME 2688 validation. If the owner of the domain has outsourced operation of 2689 DNS or web services to a hosting provider, there is nothing that can 2690 be done against tampering by the hosting provider. As far as the 2691 outside world is concerned, the zone or web site provided by the 2692 hosting provider is the real thing. 2694 More limited forms of delegation can also lead to an unintended party 2695 gaining the ability to successfully complete a validation 2696 transaction. For example, suppose an ACME server follows HTTP 2697 redirects in HTTP validation and a web site operator provisions a 2698 catch-all redirect rule that redirects requests for unknown resources 2699 to a different domain. Then the target of the redirect could use 2700 that to get a certificate through HTTP validation, since the 2701 validation path will not be known to the primary server. 2703 The DNS is a common point of vulnerability for all of these 2704 challenges. An entity that can provision false DNS records for a 2705 domain can attack the DNS challenge directly, and can provision false 2706 A/AAAA records to direct the ACME server to send its TLS SNI or HTTP 2707 validation query to a server of the attacker's choosing. There are a 2708 few different mitigations that ACME servers can apply: 2710 o Always querying the DNS using a DNSSEC-validating resolver 2711 (enhancing security for zones that are DNSSEC-enabled) 2713 o Querying the DNS from multiple vantage points to address local 2714 attackers 2716 o Applying mitigations against DNS off-path attackers, e.g., adding 2717 entropy to requests [I-D.vixie-dnsext-dns0x20] or only using TCP 2719 Given these considerations, the ACME validation process makes it 2720 impossible for any attacker on the ACME channel, or a passive 2721 attacker on the validation channel to hijack the authorization 2722 process to authorize a key of the attacker's choice. 2724 An attacker that can only see the ACME channel would need to convince 2725 the validation server to provide a response that would authorize the 2726 attacker's account key, but this is prevented by binding the 2727 validation response to the account key used to request challenges. A 2728 passive attacker on the validation channel can observe the correct 2729 validation response and even replay it, but that response can only be 2730 used with the account key for which it was generated. 2732 An active attacker on the validation channel can subvert the ACME 2733 process, by performing normal ACME transactions and providing a 2734 validation response for his own account key. The risks due to 2735 hosting providers noted above are a particular case. For identifiers 2736 where the server already has some public key associated with the 2737 domain this attack can be prevented by requiring the client to prove 2738 control of the corresponding private key. 2740 9.3. Denial-of-Service Considerations 2742 As a protocol run over HTTPS, standard considerations for TCP-based 2743 and HTTP-based DoS mitigation also apply to ACME. 2745 At the application layer, ACME requires the server to perform a few 2746 potentially expensive operations. Identifier validation transactions 2747 require the ACME server to make outbound connections to potentially 2748 attacker-controlled servers, and certificate issuance can require 2749 interactions with cryptographic hardware. 2751 In addition, an attacker can also cause the ACME server to send 2752 validation requests to a domain of its choosing by submitting 2753 authorization requests for the victim domain. 2755 All of these attacks can be mitigated by the application of 2756 appropriate rate limits. Issues closer to the front end, like POST 2757 body validation, can be addressed using HTTP request limiting. For 2758 validation and certificate requests, there are other identifiers on 2759 which rate limits can be keyed. For example, the server might limit 2760 the rate at which any individual account key can issue certificates, 2761 or the rate at which validation can be requested within a given 2762 subtree of the DNS. 2764 9.4. Server-Side Request Forgery 2766 Server-Side Request Forgery (SSRF) attacks can arise when an attacker 2767 can cause a server to perform HTTP requests to an attacker-chosen 2768 URL. In the ACME HTTP challenge validation process, the ACME server 2769 performs an HTTP GET request to a URL in which the attacker can 2770 choose the domain. This request is made before the server has 2771 verified that the client controls the domain, so any client can cause 2772 a query to any domain. 2774 Some server implementations include information from the validation 2775 server's response (in order to facilitate debugging). Such 2776 implementations enable an attacker to extract this information from 2777 any web server that is accessible to the ACME server, even if it is 2778 not accessible to the ACME client. 2780 It might seem that the risk of SSRF through this channel is limited 2781 by the fact that the attacker can only control the domain of the URL, 2782 not the path. However, if the attacker first sets the domain to one 2783 they control, then they can send the server an HTTP redirect (e.g., a 2784 302 response) which will cause the server to query an arbitrary URI. 2786 In order to further limit the SSRF risk, ACME server operators should 2787 ensure that validation queries can only be sent to servers on the 2788 public Internet, and not, say, web services within the server 2789 operator's internal network. Since the attacker could make requests 2790 to these public servers himself, he can't gain anything extra through 2791 an SSRF attack on ACME aside from a layer of anonymization. 2793 9.5. CA Policy Considerations 2795 The controls on issuance enabled by ACME are focused on validating 2796 that a certificate applicant controls the identifier he claims. 2797 Before issuing a certificate, however, there are many other checks 2798 that a CA might need to perform, for example: 2800 o Has the client agreed to a subscriber agreement? 2802 o Is the claimed identifier syntactically valid? 2804 o For domain names: 2806 * If the leftmost label is a '*', then have the appropriate 2807 checks been applied? 2809 * Is the name on the Public Suffix List? 2811 * Is the name a high-value name? 2813 * Is the name a known phishing domain? 2815 o Is the key in the CSR sufficiently strong? 2817 o Is the CSR signed with an acceptable algorithm? 2819 CAs that use ACME to automate issuance will need to ensure that their 2820 servers perform all necessary checks before issuing. 2822 10. Operational Considerations 2824 There are certain factors that arise in operational reality that 2825 operators of ACME-based CAs will need to keep in mind when 2826 configuring their services. For example: 2828 10.1. DNS over TCP 2830 As noted above, DNS forgery attacks against the ACME server can 2831 result in the server making incorrect decisions about domain control 2832 and thus mis-issuing certificates. Servers SHOULD verify DNSSEC when 2833 it is available for a domain. When DNSSEC is not available, servers 2834 SHOULD perform DNS queries over TCP, which provides better resistance 2835 to some forgery attacks than DNS over UDP. 2837 10.2. Default Virtual Hosts 2839 In many cases, TLS-based services are deployed on hosted platforms 2840 that use the Server Name Indication (SNI) TLS extension to 2841 distinguish between different hosted services or "virtual hosts". 2842 When a client initiates a TLS connection with an SNI value indicating 2843 a provisioned host, the hosting platform routes the connection to 2844 that host. 2846 When a connection comes in with an unknown SNI value, one might 2847 expect the hosting platform to terminate the TLS connection. 2848 However, some hosting platforms will choose a virtual host to be the 2849 "default", and route connections with unknown SNI values to that 2850 host. 2852 In such cases, the owner of the default virtual host can complete a 2853 TLS-based challenge (e.g., "tls-sni-02") for any domain with an A 2854 record that points to the hosting platform. This could result in 2855 mis-issuance in cases where there are multiple hosts with different 2856 owners resident on the hosting platform. 2858 A CA that accepts TLS-based proof of domain control should attempt to 2859 check whether a domain is hosted on a domain with a default virtual 2860 host before allowing an authorization request for this host to use a 2861 TLS-based challenge. A default virtual host can be detected by 2862 initiating TLS connections to the host with random SNI values within 2863 the namespace used for the TLS-based challenge (the "acme.invalid" 2864 namespace for "tls-sni-02"). 2866 10.3. Use of DNSSEC Resolvers 2868 An ACME-based CA will often need to make DNS queries, e.g., to 2869 validate control of DNS names. Because the security of such 2870 validations ultimately depends on the authenticity of DNS data, every 2871 possible precaution should be taken to secure DNS queries done by the 2872 CA. It is therefore RECOMMENDED that ACME-based CAs make all DNS 2873 queries via DNSSEC-validating stub or recursive resolvers. This 2874 provides additional protection to domains which choose to make use of 2875 DNSSEC. 2877 An ACME-based CA must use only a resolver if it trusts the resolver 2878 and every component of the network route by which it is accessed. It 2879 is therefore RECOMMENDED that ACME-based CAs operate their own 2880 DNSSEC-validating resolvers within their trusted network and use 2881 these resolvers both for both CAA record lookups and all record 2882 lookups in furtherance of a challenge scheme (A, AAAA, TXT, etc.). 2884 11. Acknowledgements 2886 In addition to the editors listed on the front page, this document 2887 has benefited from contributions from a broad set of contributors, 2888 all the way back to its inception. 2890 o Peter Eckersley, EFF 2892 o Eric Rescorla, Mozilla 2894 o Seth Schoen, EFF 2896 o Alex Halderman, University of Michigan 2898 o Martin Thomson, Mozilla 2900 o Jakub Warmuz, University of Oxford 2902 This document draws on many concepts established by Eric Rescorla's 2903 "Automated Certificate Issuance Protocol" draft. Martin Thomson 2904 provided helpful guidance in the use of HTTP. 2906 12. References 2908 12.1. Normative References 2910 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2911 Requirement Levels", BCP 14, RFC 2119, 2912 DOI 10.17487/RFC2119, March 1997, 2913 . 2915 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, 2916 DOI 10.17487/RFC2818, May 2000, 2917 . 2919 [RFC2985] Nystrom, M. and B. Kaliski, "PKCS #9: Selected Object 2920 Classes and Attribute Types Version 2.0", RFC 2985, 2921 DOI 10.17487/RFC2985, November 2000, 2922 . 2924 [RFC2986] Nystrom, M. and B. Kaliski, "PKCS #10: Certification 2925 Request Syntax Specification Version 1.7", RFC 2986, 2926 DOI 10.17487/RFC2986, November 2000, 2927 . 2929 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 2930 Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002, 2931 . 2933 [RFC3492] Costello, A., "Punycode: A Bootstring encoding of Unicode 2934 for Internationalized Domain Names in Applications 2935 (IDNA)", RFC 3492, DOI 10.17487/RFC3492, March 2003, 2936 . 2938 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 2939 Resource Identifier (URI): Generic Syntax", STD 66, 2940 RFC 3986, DOI 10.17487/RFC3986, January 2005, 2941 . 2943 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 2944 Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, 2945 . 2947 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 2948 (TLS) Protocol Version 1.2", RFC 5246, 2949 DOI 10.17487/RFC5246, August 2008, 2950 . 2952 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 2953 Housley, R., and W. Polk, "Internet X.509 Public Key 2954 Infrastructure Certificate and Certificate Revocation List 2955 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 2956 . 2958 [RFC5890] Klensin, J., "Internationalized Domain Names for 2959 Applications (IDNA): Definitions and Document Framework", 2960 RFC 5890, DOI 10.17487/RFC5890, August 2010, 2961 . 2963 [RFC5988] Nottingham, M., "Web Linking", RFC 5988, 2964 DOI 10.17487/RFC5988, October 2010, 2965 . 2967 [RFC6066] Eastlake 3rd, D., "Transport Layer Security (TLS) 2968 Extensions: Extension Definitions", RFC 6066, 2969 DOI 10.17487/RFC6066, January 2011, 2970 . 2972 [RFC6570] Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., 2973 and D. Orchard, "URI Template", RFC 6570, 2974 DOI 10.17487/RFC6570, March 2012, 2975 . 2977 [RFC6844] Hallam-Baker, P. and R. Stradling, "DNS Certification 2978 Authority Authorization (CAA) Resource Record", RFC 6844, 2979 DOI 10.17487/RFC6844, January 2013, 2980 . 2982 [RFC7159] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 2983 Interchange Format", RFC 7159, DOI 10.17487/RFC7159, March 2984 2014, . 2986 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 2987 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 2988 DOI 10.17487/RFC7231, June 2014, 2989 . 2991 [RFC7468] Josefsson, S. and S. Leonard, "Textual Encodings of PKIX, 2992 PKCS, and CMS Structures", RFC 7468, DOI 10.17487/RFC7468, 2993 April 2015, . 2995 [RFC7515] Jones, M., Bradley, J., and N. Sakimura, "JSON Web 2996 Signature (JWS)", RFC 7515, DOI 10.17487/RFC7515, May 2997 2015, . 2999 [RFC7517] Jones, M., "JSON Web Key (JWK)", RFC 7517, 3000 DOI 10.17487/RFC7517, May 2015, 3001 . 3003 [RFC7518] Jones, M., "JSON Web Algorithms (JWA)", RFC 7518, 3004 DOI 10.17487/RFC7518, May 2015, 3005 . 3007 [RFC7638] Jones, M. and N. Sakimura, "JSON Web Key (JWK) 3008 Thumbprint", RFC 7638, DOI 10.17487/RFC7638, September 3009 2015, . 3011 [RFC7807] Nottingham, M. and E. Wilde, "Problem Details for HTTP 3012 APIs", RFC 7807, DOI 10.17487/RFC7807, March 2016, 3013 . 3015 12.2. Informative References 3017 [I-D.vixie-dnsext-dns0x20] 3018 Vixie, P. and D. Dagon, "Use of Bit 0x20 in DNS Labels to 3019 Improve Transaction Identity", draft-vixie-dnsext- 3020 dns0x20-00 (work in progress), March 2008. 3022 [RFC3552] Rescorla, E. and B. Korver, "Guidelines for Writing RFC 3023 Text on Security Considerations", BCP 72, RFC 3552, 3024 DOI 10.17487/RFC3552, July 2003, 3025 . 3027 [RFC3553] Mealling, M., Masinter, L., Hardie, T., and G. Klyne, "An 3028 IETF URN Sub-namespace for Registered Protocol 3029 Parameters", BCP 73, RFC 3553, DOI 10.17487/RFC3553, June 3030 2003, . 3032 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 3033 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 3034 DOI 10.17487/RFC5226, May 2008, 3035 . 3037 [RFC5785] Nottingham, M. and E. Hammer-Lahav, "Defining Well-Known 3038 Uniform Resource Identifiers (URIs)", RFC 5785, 3039 DOI 10.17487/RFC5785, April 2010, 3040 . 3042 [RFC6962] Laurie, B., Langley, A., and E. Kasper, "Certificate 3043 Transparency", RFC 6962, DOI 10.17487/RFC6962, June 2013, 3044 . 3046 [RFC7469] Evans, C., Palmer, C., and R. Sleevi, "Public Key Pinning 3047 Extension for HTTP", RFC 7469, DOI 10.17487/RFC7469, April 3048 2015, . 3050 [W3C.CR-cors-20130129] 3051 Kesteren, A., "Cross-Origin Resource Sharing", World Wide 3052 Web Consortium CR CR-cors-20130129, January 2013, 3053 . 3055 Authors' Addresses 3057 Richard Barnes 3058 Mozilla 3060 Email: rlb@ipv.sx 3062 Jacob Hoffman-Andrews 3063 EFF 3065 Email: jsha@eff.org 3067 James Kasten 3068 University of Michigan 3070 Email: jdkasten@umich.edu