ACME TLS ALPN Challenge ExtensionInternet Security Research Grouproland@letsencrypt.org
General
ACME Working GroupThis document specifies a new challenge for the Automated Certificate Management Environment (ACME) protocol which allows for domain control validation using TLS.The Automatic Certificate Management Environment (ACME) specification doesn’t specify a TLS layer validation method which limits the points at which validation can be performed. This document extends the ACME specification to include a TLS based validation method that uses the Application Level Protocol Negotiation extension.In this document, the key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL
NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” are to be
interpreted as described in BCP 14, RFC 2119 .The TLS with Application Level Protocol Negotiation (TLS ALPN) validation method proves control over a domain name by requiring the client to configure a TLS server referenced by the DNS A and/or AAAA Resource Records for the domain name to respond to specific connection attempts utilizing the ALPN extension . The server validates control of the domain name by connecting to the TLS server and verifying a certificate with specific content is presented.
The string “tls-alpn-01”
A random value that uniquely identifies the challenge. This value MUST have
at least 128 bits of entropy. It MUST NOT contain any characters outside the
base64url alphabet, including padding characters (“=”).The client prepares for validation by constructing a self-signed certificate which MUST contain a acmeValidation-v1 extension and a subjectAlternativeName extension . The subjectAlternativeName extension MUST contain a single dNSName entry where the value is the domain name being validated. The acmeValidation-v1 extension MUST contain the SHA-256 digest of the key authorization for the challenge. The acmeValidation extension MUST be critical so that the certificate isn’t inadvertently used to make trust decisions.Once this certificate has been created it MUST be provisioned such that it is returned during a TLS handshake that contains a ALPN extension containing the value “acme-tls/1” and a SNI extension containing the domain name being validated.When ready the client acknowledges this by sending a POST message containing the key authorization, as defined in section 8.1, to the challenge URL.
The key authorization for this challenge. This value MUST match the token
from the challenge and the client’s account key.On receiving this the server MUST verify that the key authorization in the request matches the “token” value in the challenge and the client’s account key. If they do not match then the server MUST return a HTTP error in response to the POST request in which the client sent the challenge.The server then verifies the client’s control over the domain by verifying that the TLS server was configured as expected using these steps:Compute the expected SHA-256 digest of the expected key authorization.Initiate a TLS connection with the domain name being validated, this connection MUST be sent to TCP port 443. The ClientHello that initiates the handshake MUST contain a ALPN extension with the value “acme-tls/1” and a Server Name Indication extension containing the domain name being validated.Verify that the ServerHello contains a ALPN extension containing the value “acme-tls/1” and that the certificate returned contains a subjectAltName extension containing the dNSName being validated and no other entries and a critical acmeValidation extension containing the digest computed in step 1. The comparison of dNSNames MUST be case insensitive . Note that as ACME doesn’t support Unicode identifiers all dNSNames MUST be encoded using the rules.If all of the above steps succeed then the validation is successful, otherwise it fails. Once the handshake has been completed the connection should be immediately closed and no further data should be exchanged.The “acme-tls/1” protocol MUST only be used for validating ACME tls-alpn-01 challenges. The protocol consists of a TLS handshake in which the required validation information is transmitted. Once the handshake is complete the client MUST not exchange any further data with the server and MUST immediately close the connection.The design of this challenges relies on some assumptions centered around how a server behaves during validation.The first assumption is that when a server is being used to serve content for multiple DNS names from a single IP address that it properly segregates control of those names to the users on the server that own them. This means that if User A registers Host A and User B registers Host B the server should not allow a TLS request using a SNI value for Host A that only User A should be able to serve that request. If the server allows User B to serve this request it allows them to illegitimately validate control of Host A to the ACME server.The second assumption is that a server will not blindly agree to use the acme-tls/1 protocol without actually knowing about the protocol itself, which is a violation of .Within the SMI-numbers registry, the “SMI Security for PKIX Certificate Extension (1.3.6.1.5.5.7.1)” table is to be updated to include the following entry:DecimalDescriptionReferences30id-pe-acmeIdentifierRFC XXXXThe “ACME Validation Methods” registry is to be updated to include the following entry:LabelIdentifier TypeReferencetls-alpn-01dnsRFC XXXXThe TLS ALPN challenge exists to replace the TLS SNI challenge defined in the original ACME document. This challenge allowed validation of domain control purely within the TLS layer which provided convenience for server operators who were either operating large TLS layer load balancing systems at which they wanted to perform validation or running servers fronting large numbers of DNS names from a single host.A security issue was discovered in the TLS SNI challenge which allowed users of certain service providers to illegitimately validate control of the DNS names of other users, as long as those users were also using those service providers. When the TLS SNI challenge was designed it was assumed that a user would only be able to claim TLS traffic via SNI for domain names they controlled (i.e. if User A registered Host A with a service provider they wouldn’t be able to claim SNI traffic for Host B). This turns out not to be a security property provided by a number of large service providers. Because of this users were able to claim SNI traffic for the non-valid SNI names the TLS SNI challenge used to signal what was being validated to the server. This meant that if User A and User B had registered Host A and Host B respectively User A would be able to claim the SNI name for a validation for Host B and when the validation connection was made to the shared IP address that User A would be able to answer, proving control.The author would like to thank all those whom have provided design insights and editorial review of this document, including Richard Barnes, Ryan Hurst, Adam Langley, Ryan Sleevi, Jacob Hoffman-Andrews, Marcin Walas, and Martin Thomson.Key words for use in RFCs to Indicate Requirement LevelsIn many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.Punycode: A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)Punycode is a simple and efficient transfer encoding syntax designed for use with Internationalized Domain Names in Applications (IDNA). It uniquely and reversibly transforms a Unicode string into an ASCII string. ASCII characters in the Unicode string are represented literally, and non-ASCII characters are represented by ASCII characters that are allowed in host name labels (letters, digits, and hyphens). This document defines a general algorithm called Bootstring that allows a string of basic code points to uniquely represent any string of code points drawn from a larger set. Punycode is an instance of Bootstring that uses particular parameter values specified by this document, appropriate for IDNA. [STANDARDS-TRACK]Domain Name System (DNS) Case Insensitivity ClarificationDomain Name System (DNS) names are "case insensitive". This document explains exactly what that means and provides a clear specification of the rules. This clarification updates RFCs 1034, 1035, and 2181. [STANDARDS-TRACK]Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) ProfileThis memo profiles the X.509 v3 certificate and X.509 v2 certificate revocation list (CRL) for use in the Internet. An overview of this approach and model is provided as an introduction. The X.509 v3 certificate format is described in detail, with additional information regarding the format and semantics of Internet name forms. Standard certificate extensions are described and two Internet-specific extensions are defined. A set of required certificate extensions is specified. The X.509 v2 CRL format is described in detail along with standard and Internet-specific extensions. An algorithm for X.509 certification path validation is described. An ASN.1 module and examples are provided in the appendices. [STANDARDS-TRACK]Transport Layer Security (TLS) Extensions: Extension DefinitionsThis document provides specifications for existing TLS extensions. It is a companion document for RFC 5246, "The Transport Layer Security (TLS) Protocol Version 1.2". The extensions specified are server_name, max_fragment_length, client_certificate_url, trusted_ca_keys, truncated_hmac, and status_request. [STANDARDS-TRACK]Transport Layer Security (TLS) Application-Layer Protocol Negotiation ExtensionThis document describes a Transport Layer Security (TLS) extension for application-layer protocol negotiation within the TLS handshake. For instances in which multiple application protocols are supported on the same TCP or UDP port, this extension allows the application layer to negotiate which protocol will be used within the TLS connection.Automatic Certificate Management Environment (ACME)Certificates in PKI using X.509 (PKIX) are used for a number of purposes, the most significant of which is the authentication of domain names. Thus, certificate authorities in the Web PKI are trusted to verify that an applicant for a certificate legitimately represents the domain name(s) in the certificate. Today, this verification is done through a collection of ad hoc mechanisms. This document describes a protocol that a certification authority (CA) and an applicant can use to automate the process of verification and certificate issuance. The protocol also provides facilities for other certificate management functions, such as certificate revocation. RFC EDITOR: PLEASE REMOVE THE FOLLOWING PARAGRAPH: The source for this draft is maintained in GitHub. Suggested changes should be submitted as pull requests at https://github.com/ietf-wg-acme/acme [1]. Instructions are on that page as well. Editorial changes can be managed in GitHub, but any substantive change should be discussed on the ACME mailing list (acme@ietf.org).NIST FIPS 180-4, Secure Hash Standard