Internet-Draft | Service Identity | June 2021 |
Saint-Andre, et al. | Expires 31 December 2021 | [Page] |
Many application technologies enable secure communication between two entities by means of Internet Public Key Infrastructure Using X.509 (PKIX) certificates in the context of Transport Layer Security (TLS). This document specifies procedures for representing and verifying the identity of application services in such interactions.¶
This note is to be removed before publishing as an RFC.¶
Discussion of this document takes place on the Using TLS in Applications Working Group mailing list (uta@ietf.org), which is archived at https://mailarchive.ietf.org/arch/browse/uta/.¶
Source for this draft and an issue tracker can be found at https://github.com/richsalz/draft-ietf-uta-rfc6125bis.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 31 December 2021.¶
Copyright (c) 2021 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.¶
The visible face of the Internet largely consists of services that employ a client-server architecture in which an interactive or automated client communicates with an application service in order to retrieve or upload information, communicate with other entities, or access a broader network of services. When a client communicates with an application service using Transport Layer Security [TLS] or Datagram Transport Layer Security [DTLS], it references some notion of the server's identity (e.g., "the website at example.com") while attempting to establish secure communication. Likewise, during TLS negotiation, the server presents its notion of the service's identity in the form of a public-key certificate that was issued by a certification authority (CA) in the context of the Internet Public Key Infrastructure using X.509 [PKIX]. Informally, we can think of these identities as the client's "reference identity" and the server's "presented identity" (these rough ideas are defined more precisely later in this document through the concept of particular identifiers). In general, a client needs to verify that the server's presented identity matches its reference identity so it can authenticate the communication.¶
Many application technologies adhere to the pattern just outlined. Such protocols have traditionally specified their own rules for representing and verifying application service identity. Unfortunately, this divergence of approaches has caused some confusion among certification authorities, application developers, and protocol designers.¶
Therefore, to codify secure procedures for the implementation and deployment of PKIX-based authentication, this document specifies recommended procedures for representing and verifying application service identity in certificates intended for use in application protocols employing TLS.¶
The primary audience for this document consists of application protocol designers, who can reference this document instead of defining their own rules for the representation and verification of application service identity. Secondarily, the audience consists of certification authorities, service providers, and client developers from technology communities that might reuse the recommendations in this document when defining certificate issuance policies, generating certificate signing requests, or writing software algorithms for identity matching.¶
This document is longer than the authors would have liked because it was necessary to carefully define terminology, explain the underlying concepts, define the scope, and specify recommended behavior for both certification authorities and application software implementations. The following sections are of special interest to various audiences:¶
The sections on terminology (Section 1.7), naming of application services (Section 2), document scope (Section 1.6), and the like provide useful background information regarding the recommendations and guidelines that are contained in the above-referenced sections, but are not absolutely necessary for a first reading of this document.¶
This document does not supersede the rules for certificate issuance or validation provided in [PKIX]. Therefore, [PKIX] is authoritative on any point that might also be discussed in this document. Furthermore, [PKIX] also governs any certificate-related topic on which this document is silent, including but not limited to certificate syntax, certificate extensions such as name constraints and extended key usage, and handling of certification paths.¶
This document addresses only name forms in the leaf "end entity" server certificate, not any name forms in the chain of certificates used to validate the server certificate. Therefore, in order to ensure proper authentication, application clients need to verify the entire certification path per [PKIX].¶
This document also does not supersede the rules for verifying service identity provided in specifications for existing application protocols published prior to this document. However, the procedures described here can be referenced by future specifications, including updates to specifications for existing application protocols if the relevant technology communities agree to do so.¶
To orient the reader, this section provides an informational overview of the recommendations contained in this document.¶
The previous version of this specification, [VERIFY], surveyed the current practice from many IETF standards and tried to generalize best practices. This document takes the lessons learned in the past decade and codifies them as best practices.¶
For the primary audience of application protocol designers, this document provides recommended procedures for the representation and verification of application service identity within PKIX certificates used in the context of TLS.¶
For the secondary audiences, in essence this document encourages certification authorities, application service providers, and application client developers to coalesce on the following practices:¶
*.example.com
).¶
This document applies only to service identities associated with fully qualified DNS domain names, only to TLS and DTLS (or the older Secure Sockets Layer (SSL) technology), and only to PKIX-based systems. As a result, the scenarios described in the following section are out of scope for this specification (although they might be addressed by future specifications).¶
The following topics are out of scope for this specification:¶
Client or end-user identities.¶
Certificates representing client or end-user identities (e.g., the rfc822Name identifier) can be used for mutual authentication between a client and server or between two clients, thus enabling stronger client-server security or end-to-end security. However, certification authorities, application developers, and service operators have less experience with client certificates than with server certificates, thus giving us fewer models from which to generalize and a less solid basis for defining best practices.¶
Identifiers other than fully qualified DNS domain names.¶
Some certification authorities issue server certificates based on IP addresses, but preliminary evidence indicates that such certificates are a very small percentage (less than 1%) of issued certificates. Furthermore, IP addresses are not necessarily reliable identifiers for application services because of the existence of private internets [PRIVATE], host mobility, multiple interfaces on a given host, Network Address Translators (NATs) resulting in different addresses for a host from different locations on the network, the practice of grouping many hosts together behind a single IP address, etc. Most fundamentally, most users find DNS domain names much easier to work with than IP addresses, which is why the domain name system was designed in the first place. We prefer to define best practices for the much more common use case and not to complicate the rules in this specification.¶
Furthermore, we focus here on application service identities, not specific resources located at such services. Therefore this document discusses Uniform Resource Identifiers [URI] only as a way to communicate a DNS domain name (via the URI "host" component or its equivalent), not as a way to communicate other aspects of a service such as a specific resource (via the URI "path" component) or parameters (via the URI "query" component).¶
We also do not discuss attributes unrelated to DNS domain names, such as those defined in [X.520] and other such specifications (e.g., organizational attributes, geographical attributes, company logos, and the like).¶
Security protocols other than [TLS], [DTLS], or the older Secure Sockets Layer (SSL) technology.¶
Although other secure, lower-layer protocols exist and even employ PKIX certificates at times (e.g., IPsec [IPSEC]), their use cases can differ from those of TLS-based and DTLS-based application technologies. Furthermore, application technologies have less experience with IPsec than with TLS, thus making it more difficult to gather feedback on proposed best practices.¶
Keys or certificates employed outside the context of PKIX-based systems.¶
Some deployed application technologies use a web of trust model based on or similar to OpenPGP [OPENPGP], or use self-signed certificates, or are deployed on networks that are not directly connected to the public Internet and therefore cannot depend on Certificate Revocation Lists (CRLs) or the Online Certificate Status Protocol [OCSP] to check CA-issued certificates. However, the method for binding a public key to an identifier in OpenPGP differs essentially from the method in X.509, the data in self-signed certificates has not been certified by a third party in any way, and checking of CA-issued certificates via CRLs or OCSP is critically important to maintaining the security of PKIX-based systems. Attempting to define best practices for such technologies would unduly complicate the rules defined in this specification.¶
Certification authority policies, such as:¶
Resolution of DNS domain names.¶
Although the process whereby a client resolves the DNS domain name of an application service can involve several steps (e.g., this is true of resolutions that depend on DNS SRV resource records, Naming Authority Pointer (NAPTR) DNS resource records [NAPTR], and related technologies such as [S-NAPTR]), for our purposes we care only about the fact that the client needs to verify the identity of the entity with which it communicates as a result of the resolution process. Thus the resolution process itself is out of scope for this specification.¶
User interface issues.¶
In general, such issues are properly the responsibility of client software developers and standards development organizations dedicated to particular application technologies (see, for example, [WSC-UI]).¶
Because many concepts related to "identity" are often too vague to be actionable in application protocols, we define a set of more concrete terms for use in this specification.¶
A service on the Internet that enables interactive and automated clients to connect for the purpose of retrieving or uploading information, communicating with other entities, or connecting to a broader network of services.¶
An organization or individual that hosts or deploys an application service.¶
A formal identifier for the application protocol used to provide a particular kind of application service at a domain; the application service type typically takes the form of a Uniform Resource Identifier scheme [URI] or a DNS SRV Service [DNS-SRV].¶
A colloquial name for the ASN.1-based construction comprising a Relative Distinguished Name (RDN), which itself is a building-block component of Distinguished Names. See Section 2 of [LDAP-DN].¶
A software agent or device that is not directly controlled by a human user.¶
A domain name or host name that is explicitly configured for communicating with the source domain, by either (a) the human user controlling an interactive client or (b) a trusted administrator. In case (a), one example of delegation is an account setup that specifies the domain name of a particular host to be used for retrieving information or connecting to a network, which might be different from the server portion of the user's account name (e.g., a server at mailhost.example.com for connecting to an IMAP server hosting an email address of juliet@example.com). In case (b), one example of delegation is an admin-configured host-to-address/address-to-host lookup table.¶
A domain name or host name that a client has derived from the source domain in an automated fashion (e.g., by means of a [DNS-SRV] lookup).¶
A particular instance of an identifier type that is either presented by a server in a certificate or referenced by a client for matching purposes.¶
A formally defined category of identifier that can be included in a certificate and therefore that can also be used for matching purposes. For conciseness and convenience, we define the following identifier types of interest, which are based on those found in the PKIX specification [PKIX] and various PKIX extensions.¶
A software agent or device that is directly controlled by a human user. (Other specifications related to security and application protocols, such as [WSC-UI], often refer to this entity as a "user agent".)¶
The act of establishing a cached name association between the application service's certificate and one of the client's reference identifiers, despite the fact that none of the presented identifiers matches the given reference identifier. Pinning is accomplished by allowing a human user to positively accept the mismatch during an attempt to communicate with the application service. Once a cached name association is established, the certificate is said to be pinned to the reference identifier and in future communication attempts the client simply verifies that the service's presented certificate matches the pinned certificate, as described under Section 6.6.2. (A similar definition of "pinning" is provided in [WSC-UI].)¶
PKIX is a short name for the Internet Public Key Infrastructure using X.509 defined in RFC 5280 [PKIX], which comprises a profile of the X.509v3 certificate specifications and X.509v2 certificate revocation list (CRL) specifications for use in the Internet.¶
A software implementation or deployed service that makes use of X.509v3 certificates and X.509v2 certificate revocation lists (CRLs).¶
An X.509v3 certificate generated and employed in the context of PKIX.¶
An identifier that is presented by a server to a client within a PKIX certificate when the client attempts to establish secure communication with the server; the certificate can include one or more presented identifiers of different types, and if the server hosts more than one domain then the certificate might present distinct identifiers for each domain.¶
An identifier, constructed from a source domain and optionally an application service type, used by the client for matching purposes when examining presented identifiers.¶
The fully qualified DNS domain name
that a client expects an application service to present in the certificate
(e.g., www.example.com
), typically input by a human user, configured into
a
client, or provided by reference such as in a hyperlink. The combination
of a
source domain and, optionally, an application service type enables a client
to construct one or more reference identifiers.¶
An identifier placed in a subjectAltName extension.¶
A standard PKIX certificate extension [PKIX] enabling identifiers of various types to be bound to the certificate subject -- in addition to, or in place of, identifiers that may be embedded within or provided as a certificate's subject field.¶
The subject field of a PKIX certificate identifies the entity associated with the public key stored in the subject public key field (see Section 4.1.2.6 of [PKIX]).¶
In an overall sense, a subject's name(s) can be represented by or in the subject field, the subjectAltName extension, or both (see [PKIX] for details). More specifically, the term often refers to the name of a PKIX certificate's subject, encoded as the X.501 type Name and conveyed in a certificate's subject field (see Section 4.1.2.6 of [PKIX]).¶
An entity that assumes the role of a client in a Transport Layer Security [TLS] negotiation. In this specification we generally assume that the TLS client is an (interactive or automated) application client; however, in application protocols that enable server-to-server communication, the TLS client could be a peer application service.¶
An entity that assumes the role of a server in a Transport Layer Security [TLS] negotiation; in this specification we assume that the TLS server is an application service.¶
Most security-related terms in this document are to be understood in the sense defined in [SECTERMS]; such terms include, but are not limited to, "attack," "authentication," "authorization," "certification authority," "certification path," "certificate," "credential," "identity," "self-signed certificate," "trust," "trust anchor," "trust chain," "validate," and "verify".¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
This section discusses naming of application services on the Internet, followed by a brief tutorial about subject naming in PKIX.¶
This specification assumes that the name of an application service is
based on a DNS domain name (e.g., example.com
) -- supplemented in
some circumstances by an application service type (e.g., "the IMAP
server at example.com").¶
From the perspective of the application client or user, some names are direct because they are provided directly by a human user (e.g., via runtime input, prior configuration, or explicit acceptance of a client communication attempt), whereas other names are indirect because they are automatically resolved by the client based on user input (e.g., a target name resolved from a source name using DNS SRV or NAPTR records). This dimension matters most for certificate consumption, specifically verification as discussed in this document.¶
From the perspective of the application service, some names are unrestricted because they can be used in any type of service (e.g., a certificate might be reused for both the HTTP service and the IMAP service at example.com), whereas other names are restricted because they can be used in only one type of service (e.g., a special-purpose certificate that can be used only for an IMAP service). This dimension matters most for certificate issuance.¶
Therefore, we can categorize the identifier types of interest as follows:¶
We summarize this taxonomy in the following table.¶
+-----------+-----------+---------------+ | | Direct | Restricted | +-----------+-----------+---------------+ | CN-ID | Yes | No | +-----------+-----------+---------------+ | DNS-ID | Yes | No | +-----------+-----------+---------------+ | SRV-ID | Either | Yes | +-----------+-----------+---------------+ | URI-ID | Yes | Yes | +-----------+-----------+---------------+¶
When implementing software, deploying services, and issuing certificates for secure PKIX-based authentication, it is important to keep these distinctions in mind. In particular, best practices differ somewhat for application server implementations, application client implementations, application service providers, and certification authorities. Ideally, protocol specifications that reference this document will specify which identifiers are mandatory-to-implement by servers and clients, which identifiers ought to be supported by certificate issuers, and which identifiers ought to be requested by application service providers. Because these requirements differ across applications, it is impossible to categorically stipulate universal rules (e.g., that all software implementations, service providers, and certification authorities for all application protocols need to use or support DNS-IDs as a baseline for the purpose of interoperability).¶
However, it is preferable that each application protocol will at least define a baseline that applies to the community of software developers, application service providers, and CAs actively using or supporting that technology (one such community, the CA/Browser Forum, has codified such a baseline for "Extended Validation Certificates" in [EV-CERTS]).¶
For the purposes of this specification, the name of an application service is (or is based on) a DNS domain name that conforms to one of the following forms:¶
In theory, the Internet Public Key Infrastructure using X.509 [PKIX] employs the global directory service model defined in [X.500] and [X.501]. Under that model, information is held in a directory information base (DIB) and entries in the DIB are organized in a hierarchy called the directory information tree (DIT). An object or alias entry in that hierarchy consists of a set of attributes (each of which has a defined type and one or more values) and is uniquely identified by a Distinguished Name (DN). The DN of an entry is constructed by combining the Relative Distinguished Names of its superior entries in the tree (all the way down to the root of the DIT) with one or more specially nominated attributes of the entry itself (which together comprise the Relative Distinguished Name (RDN) of the entry, so-called because it is relative to the Distinguished Names of the superior entries in the tree). The entry closest to the root is sometimes referred to as the "most significant" entry, and the entry farthest from the root is sometimes referred to as the "least significant" entry. An RDN is a set (i.e., an unordered group) of attribute-type-and-value pairs (see also [LDAP-DN]), each of which asserts some attribute about the entry.¶
In practice, the certificates used in [X.509] and [PKIX] borrow key concepts from X.500 and X.501 (e.g., DNs and RDNs) to identify entities, but such certificates are not necessarily part of a global directory information base. Specifically, the subject field of a PKIX certificate is an X.501 type Name that "identifies the entity associated with the public key stored in the subject public key field" (see Section 4.1.2.6 of [PKIX]). However, it is perfectly acceptable for the subject field to be empty, as long as the certificate contains a subject alternative name ("subjectAltName") extension that includes at least one subjectAltName entry, because the subjectAltName extension allows various identities to be bound to the subject (see Section 4.2.1.6 of [PKIX]). The subjectAltName extension itself is a sequence of typed entries, where each type is a distinct kind of identifier.¶
For our purposes, an application service can be identified by a name or names carried in the subject field (i.e., a CN-ID) and/or in one of the following identifier types within subjectAltName entries:¶
Existing certificates often use a CN-ID in the subject field to
represent a fully qualified DNS domain name; for example, consider the
following three subject names, where the attribute of type Common Name contains
a string whose form matches that of a fully qualified DNS domain name (im.example.org
,
mail.example.net
, and www.example.com
, respectively):¶
CN=im.example.org,O=Example Org,C=GB C=CA,O=Example Internetworking,CN=mail.example.net O=Examples-R-Us,CN=www.example.com,C=US¶
However, the Common Name is not strongly typed because a Common Name might contain a human-friendly string for the service, rather than a string whose form matches that of a fully qualified DNS domain name (a certificate with such a single Common Name will typically have at least one subjectAltName entry containing the fully qualified DNS domain name):¶
CN=A Free Chat Service,O=Example Org,C=GB¶
Or, a certificate's subject might contain both a CN-ID as well as another common name attribute containing a human-friendly string:¶
CN=A Free Chat Service,CN=im.example.org,O=Example Org,C=GB¶
In general, this specification recommends and prefers use of subjectAltName entries (DNS-ID, SRV-ID, URI-ID, etc.) over use of the subject field (CN-ID) where possible, as more completely described in the following sections. However, specifications that reuse this one can legitimately encourage continued support for the CN-ID identifier type if they have good reasons to do so, such as backward compatibility with deployed infrastructure (see, for example, [EV-CERTS]).¶
Confusion sometimes arises from different renderings or encodings of the hierarchical information contained in a certificate.¶
Certificates are binary objects and are encoded using the Distinguished Encoding Rules (DER) specified in [X.690]. However, some implementations generate displayable (a.k.a. printable) renderings of the certificate issuer, subject field, and subjectAltName extension, and these renderings convert the DER-encoded sequences into a "string representation" before being displayed. Because a certificate subject field (of type Name [X.509], the same as for a Distinguished Name (DN) [X.501]) is an ordered sequence, order is typically preserved in subject string representations, although the two most prevalent subject (and DN) string representations differ in employing left-to-right vs. right-to-left ordering. However, because a Relative Distinguished Name (RDN) is an unordered group of attribute-type-and-value pairs, the string representation of an RDN can differ from the canonical DER encoding (and the order of attribute-type-and-value pairs can differ in the RDN string representations or display orders provided by various implementations). Furthermore, various specifications refer to the order of RDNs in DNs or certificate subject fields using terminology that is implicitly related to an information hierarchy (which may or may not actually exist), such as "most specific" vs. "least specific," "left-most" vs. "right-most," "first" vs. "last," or "most significant" vs. "least significant" (see, for example, [LDAP-DN]).¶
To reduce confusion, in this specification we avoid such terms and instead use the terms provided under Section 1.7; in particular, we do not use the term "(most specific) Common Name field in the subject field" from [HTTP-TLS] and instead state that a CN-ID is a Relative Distinguished Name (RDN) in the certificate subject containing one and only one attribute-type-and-value pair of type Common Name (thus removing the possibility that an RDN might contain multiple AVAs (Attribute Value Assertions) of type CN, one of which could be considered "most specific").¶
Finally, although theoretically some consider the order of RDNs within a subject field to have meaning, in practice that rule is often not observed. An AVA of type CN is considered to be valid at any position within the subject field.¶
This section provides guidelines for designers of application protocols, in the form of a checklist to follow when reusing the recommendations provided in this document.¶
Sample text is provided under Appendix A.¶
This section provides rules and guidelines for issuers of certificates.¶
When a certification authority issues a certificate based on the fully qualified DNS domain name at which the application service provider will provide the relevant application, the following rules apply to the representation of application service identities. The reader needs to be aware that some of these rules are cumulative and can interact in important ways that are illustrated later in this document.¶
sip
but not
sips
or tel
for SIP as described in [SIP-SIPS], or perhaps
http and https for HTTP as might be described in a future
specification).¶
*
, the DNS domain name portion
of a presented identifier SHOULD NOT contain the wildcard character,
whether as the complete left-most label within the identifier
(following the description of labels and domain names in
[DNS-CONCEPTS], e.g., *.example.com
) or as a fragment thereof
(e.g., *oo.example.com
, f*o.example.com
, or fo*.example.com
). A
more detailed discussion of so-called "wildcard certificates" is
provided under Section 7.2.¶
Consider a simple website at www.example.com
, which is not
discoverable via DNS SRV lookups.
Because HTTP does not specify the use of URIs in server certificates,
a certificate for this service might include only a DNS-ID of
www.example.com
.
It might also include a CN-ID of www.example.com
for backward
compatibility with deployed infrastructure.¶
Consider an IMAP-accessible email server at the host
mail.example.net
servicing email addresses of the form
user@example.net
and discoverable via DNS SRV lookups on the
application service name of example.net
.
A certificate for this service might include SRV-IDs of
_imap.example.net
and _imaps.example.net
(see [EMAIL-SRV]) along
with DNS-IDs of example.net
and mail.example.net
.
It might also include CN-IDs of example.net
and mail.example.net
for backward compatibility with deployed infrastructure.¶
Consider a SIP-accessible voice-over-IP (VoIP) server at the host
voice.example.edu
servicing SIP addresses of the form
user@voice.example.edu
and identified by a URI of
<sip:voice.example.edu>.
A certificate for this service would include a URI-ID of
sip:voice.example.edu
(see [SIP-CERTS]) along with a DNS-ID of
voice.example.edu
.
It might also include a CN-ID of voice.example.edu
for backward
compatibility with deployed infrastructure.¶
Consider an XMPP-compatible instant messaging (IM) server at the host
im.example.org
servicing IM addresses of the form
user@im.example.org
and discoverable via DNS SRV lookups on the
im.example.org
domain.
A certificate for this service might include SRV-IDs of
_xmpp-client.im.example.org
and
_xmpp-server.im.example.org
(see [XMPP]), a DNS-ID of
im.example.org
, and an XMPP-specific XmppAddr
of im.example.org
(see [XMPP]).
It might also include a CN-ID of im.example.org
for backward
compatibility with deployed infrastructure.¶
This section provides rules and guidelines for service providers regarding the information to include in certificate signing requests (CSRs).¶
In general, service providers are encouraged to request certificates that include all of the identifier types that are required or recommended for the application service type that will be secured using the certificate to be issued.¶
If the certificate might be used for any type of application service, then the service provider is encouraged to request a certificate that includes only a DNS-ID.¶
If the certificate will be used for only a single type of application service, then the service provider is encouraged to request a certificate that includes a DNS-ID and, if appropriate for the application service type, an SRV-ID or URI-ID that limits the deployment scope of the certificate to only the defined application service type.¶
If a service provider offering multiple application service types
(e.g., a World Wide Web service, an email service, and an instant
messaging service) wishes to limit the applicability of certificates
using SRV-IDs or URI-IDs, then the service provider is encouraged to
request multiple certificates, i.e., one certificate per application
service type. Conversely, the service provider is discouraged from
requesting a single certificate containing multiple SRV-IDs or URI-IDs
identifying each different application service type.
This guideline does not apply to application service type "bundles"
that are used to identify manifold distinct access methods to the same
underlying application (e.g., an email application with access methods
denoted by the application service types of imap
, imaps
, pop3
,
pop3s
, and submission
as described in [EMAIL-SRV]).¶
This section provides rules and guidelines for implementers of application client software regarding algorithms for verification of application service identity.¶
At a high level, the client verifies the application service's identity by performing the actions listed below (which are defined in the following subsections of this document):¶
Naturally, in addition to checking identifiers, a client might complete further checks to ensure that the server is authorized to provide the requested service. However, such checking is not a matter of verifying the application service identity presented in a certificate, and therefore methods for doing so (e.g., consulting local policy information) are out of scope for this document.¶
The client MUST construct a list of acceptable reference identifiers, and MUST do so independently of the identifiers presented by the service.¶
The inputs used by the client to construct its list of reference identifiers might be a URI that a user has typed into an interface (e.g., an HTTPS URL for a website), configured account information (e.g., the domain name of a particular host or URI used for retrieving information or connecting to a network, which might be different from the DNS domain name portion of a username), a hyperlink in a web page that triggers a browser to retrieve a media object or script, or some other combination of information that can yield a source domain and an application service type.¶
The client might need to extract the source domain and application service type from the input(s) it has received. The extracted data MUST include only information that can be securely parsed out of the inputs (e.g., parsing the fully qualified DNS domain name out of the "host" component (or its equivalent) of a URI or deriving the application service type from the scheme of a URI) or information that is derived in a manner not subject to subversion by network attackers (e.g., pulling the data from a delegated domain that is explicitly established via client or system configuration, resolving the data via [DNSSEC], or obtaining the data from a third-party domain mapping service in which a human user has explicitly placed trust and with which the client communicates over a connection or association that provides both mutual authentication and integrity checking). These considerations apply only to extraction of the source domain from the inputs; naturally, if the inputs themselves are invalid or corrupt (e.g., a user has clicked a link provided by a malicious entity in a phishing attack), then the client might end up communicating with an unexpected application service.¶
sip
from the "scheme"
and parse the domain name example.net
from the "host" component
(or its equivalent).¶
Each reference identifier in the list SHOULD be based on the source domain and SHOULD NOT be based on a derived domain (e.g., a host name or domain name discovered through DNS resolution of the source domain). This rule is important because only a match between the user inputs and a presented identifier enables the client to be sure that the certificate can legitimately be used to secure the client's communication with the server. There is only one scenario in which it is acceptable for an interactive client to override the recommendation in this rule and therefore communicate with a domain name other than the source domain: because a human user has "pinned" the application service's certificate to the alternative domain name as further discussed under Section 6.6.4 and Section 7.1. In this case, the inputs used by the client to construct its list of reference identifiers might include more than one fully qualified DNS domain name, i.e., both (a) the source domain and (b) the alternative domain contained in the pinned certificate.¶
Using the combination of fully qualified DNS domain name(s) and application service type, the client constructs a list of reference identifiers in accordance with the following rules:¶
The list MAY include a CN-ID, mainly for the sake of backward compatibility with deployed infrastructure.¶
Which identifier types a client includes in its list of reference identifiers is a matter of local policy. For example, in certain deployment environments, a client that is built to connect only to a particular kind of service (e.g., only IM services) might be configured to accept as valid only certificates that include an SRV-ID for that application service type; in this case, the client would include only SRV-IDs matching the application service type in its list of reference identifiers (not, for example, DNS-IDs). By contrast, a more lenient client (even one built to connect only to a particular kind of service) might include both SRV-IDs and DNS-IDs in its list of reference identifiers.¶
A web browser that is connecting via HTTPS to the website at www.example.com
might have two reference identifiers: a DNS-ID of www.example.com
and,
as a fallback, a CN-ID of www.example.com
.¶
A mail user agent that is connecting via IMAPS to the email
service at example.net
(resolved as mail.example.net
) might have five
reference identifiers: an SRV-ID of _imaps.example.net
(see [EMAIL-SRV]),
DNS-IDs of example.net
and mail.example.net
, and, as a fallback, CN-IDs
of example.net
and mail.example.net
. (A legacy email user agent would
not support [EMAIL-SRV] and therefore would probably be explicitly configured to
connect to mail.example.net
, whereas an SRV-aware user agent would derive
example.net
from an email address of the form user@example.net
but might
also accept mail.example.net
as the DNS domain name portion of reference
identifiers for the service.)¶
A voice-over-IP (VoIP) user agent that is connecting via SIP to the voice
service at voice.example.edu
might have only one reference identifier:
a URI-ID of sip:voice.example.edu
(see [SIP-CERTS]).¶
An instant messaging (IM) client that is connecting via XMPP to the IM
service at im.example.org
might have three reference identifiers: an
SRV-ID of _xmpp-client.im.example.org
(see [XMPP]), a DNS-ID of
im.example.org
, and an XMPP-specific XmppAddr
of im.example.org
(see [XMPP]).¶
Once the client has constructed its list of reference identifiers and has received the server's presented identifiers in the form of a PKIX certificate, the client checks its reference identifiers against the presented identifiers for the purpose of finding a match. The search fails if the client exhausts its list of reference identifiers without finding a match. The search succeeds if any presented identifier matches one of the reference identifiers, at which point the client SHOULD stop the search.¶
Before applying the comparison rules provided in the following sections, the client might need to split the reference identifier into its DNS domain name portion and its application service type portion, as follows:¶
www.example.com
would result in a DNS domain name portion of www.example.com
.¶
_imaps.example.net
would be split into a DNS
domain name portion of example.net
and an application service type portion
of imaps
(mapping to an application protocol of IMAP as explained in [EMAIL-SRV]).¶
sip:voice.example.edu
would be split
into a DNS domain name portion of voice.example.edu
and an
application service type of sip
(associated with an application
protocol of SIP as explained in [SIP-CERTS]).¶
Detailed comparison rules for matching the DNS domain name portion and application service type portion of the reference identifier are provided in the following sections.¶
The client MUST match the DNS domain name portion of a reference
identifier according to the following rules (and SHOULD also check the
application service type as described under Section 6.5).
The rules differ depending on whether the domain to be checked is a
"traditional domain name" or an "internationalized domain name" (as
defined under Section 2.2).
Furthermore, to meet the needs of clients that support presented
identifiers containing the wildcard character *
, we define a
supplemental rule for so-called "wildcard certificates".
Finally, we also specify the circumstances under which it is
acceptable to check the CN-ID identifier type.¶
If the DNS domain name portion of a reference identifier is a
"traditional domain name," then matching of the reference identifier
against the presented identifier is performed by comparing the set of
domain name labels using a case-insensitive ASCII comparison, as
clarified by [DNS-CASE] (e.g., WWW.Example.Com
would be
lower-cased to www.example.com
for comparison purposes).
Each label MUST match in order for the names to be considered to
match, except as supplemented by the rule about checking of wildcard
labels (Section 6.4.3).¶
If the DNS domain name portion of a reference identifier is an internationalized domain name, then an implementation MUST convert any U-labels [IDNA-DEFS] in the domain name to A-labels before checking the domain name. In accordance with [IDNA-PROTO], A-labels MUST be compared as case-insensitive ASCII. Each label MUST match in order for the domain names to be considered to match, except as supplemented by the rule about checking of wildcard labels (Section 6.4.3; but see also Section 7.2 regarding wildcards in internationalized domain names).¶
A client employing this specification's rules MAY match the
reference identifier against a presented identifier whose DNS domain name
portion contains the wildcard character *
as part or all of a label
(following the description of labels and domain names in [DNS-CONCEPTS]).¶
For information regarding the security characteristics of wildcard certificates, see Section 7.2.¶
If a client matches the reference identifier against a presented identifier
whose DNS domain name portion contains the wildcard character *
, the following
rules apply:¶
bar.*.example.net
).¶
*.example.net
does not match 1api.foo.example.net`)¶
As noted, a client MUST NOT seek a match for a reference identifier of CN-ID if the presented identifiers include a DNS-ID, SRV-ID, URI-ID, or any application-specific identifier types supported by the client.¶
Therefore, if and only if the presented identifiers do not include a DNS-ID, SRV-ID, URI-ID, or any application-specific identifier types supported by the client, then the client MAY as a last resort check for a string whose form matches that of a fully qualified DNS domain name in a Common Name field of the subject field (i.e., a CN-ID). If the client chooses to compare a reference identifier of type CN-ID against that string, it MUST follow the comparison rules for the DNS domain name portion of an identifier of type DNS-ID, SRV-ID, or URI-ID, as described under Section 6.4.1, Section 6.4.2, and Section 6.4.3.¶
When a client checks identifiers of type SRV-ID and URI-ID, it MUST check not only the DNS domain name portion of the identifier but also the application service type portion. The client does this by splitting the identifier into the DNS domain name portion and the application service type portion (as described under Section 6.3), then checking both the DNS domain name portion (as described under Section 6.4) and the application service type portion as described in the following subsections.¶
Implementation Note: An identifier of type SRV-ID or URI-ID provides an
application service type portion to be checked, but that portion is combined
only with the DNS domain name portion of the SRV-ID or URI-ID itself. For
example, if a client's list of reference identifiers includes an SRV-ID of
_xmpp-client.im.example.org
and a DNS-ID of apps.example.net
, the client
would check (a) the combination of an application service type of
xmpp-client
and a DNS domain name of im.example.org
and (b) a DNS domain
name of apps.example.net
. However, the client would not check (c) the
combination of an application service type of xmpp-client
and a DNS domain
name of apps.example.net
because it does not have an SRV-ID of
_xmpp-client.apps.example.net
in its list of reference identifiers.¶
The application service name portion of an SRV-ID (e.g., imaps
) MUST
be matched in a case-insensitive manner, in accordance with
[DNS-SRV].
Note that the _
character is prepended to the service identifier in
DNS SRV records and in SRV-IDs (per [SRVNAME]), and thus does not
need to be included in any comparison.¶
The outcome of the matching procedure is one of the following cases.¶
If the client has found a presented identifier that matches a reference identifier, then the service identity check has succeeded. In this case, the client MUST use the matched reference identifier as the validated identity of the application service.¶
If the client does not find a presented identifier matching any of the reference identifiers but the client has previously pinned the application service's certificate to one of the reference identifiers in the list it constructed for this communication attempt (as "pinning" is explained under Section 1.7), and the presented certificate matches the pinned certificate (including the context as described under Section 7.1), then the service identity check has succeeded.¶
If the client does not find a presented identifier matching any of the reference identifiers and the client has not previously pinned the certificate to one of the reference identifiers in the list it constructed for this communication attempt, then the client MUST proceed as described under Section 6.6.4.¶
If the client is an interactive client that is directly controlled by a human user, then it SHOULD inform the user of the identity mismatch and automatically terminate the communication attempt with a bad certificate error; this behavior is preferable because it prevents users from inadvertently bypassing security protections in hostile situations.¶
Otherwise, if the client is an automated application not directly controlled by a human user, then it SHOULD terminate the communication attempt with a bad certificate error and log the error appropriately. An automated application MAY provide a configuration setting that disables this behavior, but MUST enable the behavior by default.¶
As defined under Section 1.7, a certificate is said
to be "pinned" to a DNS domain name when a user has explicitly chosen to
associate a service's certificate with that DNS domain name despite the fact
that the certificate contains some other DNS domain name (e.g., the user
has
explicitly approved apps.example.net
as a domain associated with a source
domain of example.com
). The cached name association MUST take account
of
both the certificate presented and the context in which it was accepted or
configured (where the "context" includes the chain of certificates from the
presented certificate to the trust anchor, the source domain, the application
service type, the service's derived domain and port number, and any other
relevant information provided by the user or associated by the client).¶
This document states that the wildcard character *
SHOULD NOT be
included in presented identifiers but MAY be checked by application clients
(mainly for the sake of backward compatibility with deployed infrastructure).
As a result, the rules provided in this document are more restrictive than
the rules for many existing application technologies.
Several security considerations justify tightening the rules:¶
Specifications for existing application technologies are not clear or consistent about the allowable location of the wildcard character, such as whether it can be:¶
*.example.com
)¶
fo*.example.com
, f*o.example.com
, or *oo.example.com
)¶
www.*.example.com
or www.foo*.example.com
)¶
*.co.uk
or *.com
)¶
f*b*r.example.com
¶
*.*.example.com
)¶
These ambiguities might introduce exploitable differences in identity checking behavior among client implementations and necessitate overly complex and inefficient identity checking algorithms.¶
xn--kcry6tjko*.example.org
).
Note, however, that a presented domain name identifier MAY contain
the wildcard character as long as that character occupies the entire
left-most label position, where all of the remaining labels are
valid NR-LDH labels, A-labels, or U-labels (e.g.,
*.xn--kcry6tjko.example.org
).¶
Notwithstanding the foregoing security considerations, specifications that reuse this one can legitimately encourage continued support for the wildcard character if they have good reasons to do so, such as backward compatibility with deployed infrastructure (see, for example, [EV-CERTS]).¶
Allowing internationalized domain names can lead to the inclusion of visually similar (so-called "confusable") characters in certificates; for discussion, see for example [IDNA-DEFS].¶
A given application service might be addressed by multiple DNS domain names for a variety of reasons, and a given deployment might service multiple domains (e.g., in so-called "virtual hosting" environments). In the default TLS handshake exchange, the client is not able to indicate the DNS domain name with which it wants to communicate, and the TLS server returns only one certificate for itself. Absent an extension to TLS, a typical workaround used to facilitate mapping an application service to multiple DNS domain names is to embed all of the domain names into a single certificate.¶
A more recent approach, formally specified in [TLS-EXT], is for the client to use the TLS "Server Name Indication" (SNI) extension when sending the client_hello message, stipulating the DNS domain name it desires or expects of the service. The service can then return the appropriate certificate in its Certificate message, and that certificate can represent a single DNS domain name.¶
To accommodate the workaround that was needed before the development of the SNI extension, this specification allows multiple DNS-IDs, SRV-IDs, or URI-IDs in a certificate; however, it explicitly discourages multiple CN-IDs. Although it would be preferable to forbid multiple CN-IDs entirely, there are several reasons at this time why this specification states that they SHOULD NOT (instead of MUST NOT) be included:¶
It is hoped that the recommendation regarding multiple CN-IDs can be further tightened in the future.¶
At the time of this writing, two application technologies reuse the recommendations in this specification: email [EMAIL-SRV] and XMPP [XMPP]. Here we include the text from [XMPP] to illustrate the thought process that might be followed by protocol designers for other application technologies. Specifically, because XMPP uses DNS SRV records for resolution of the DNS domain names for application services, the XMPP specification recommends the use of SRV-IDs.¶
The text regarding certificate issuance is as follows:¶
######¶
In a PKIX certificate to be presented by an XMPP server (i.e., a "server certificate"), the certificate MUST include one or more XMPP addresses (i.e., domainparts) associated with XMPP services hosted at the server. The rules and guidelines defined in this specification apply to XMPP server certificates, with the following XMPP-specific considerations:¶
_xmpp-client
application service type, whereas XMPP server
implementations need to support both the _xmpp-client
and
_xmpp-server
application service types).
Certification authorities that issue XMPP-specific certificates
SHOULD support the SRV-ID identifier type.
XMPP service providers SHOULD include the SRV-ID identifier type in
certificate requests.¶
*
as the complete left-most label within the
identifier.¶
######¶
The text regarding certificate verification is as follows:¶
######¶
For server certificates, the rules and guidelines defined in this specification apply, with the proviso that the XmppAddr identifier is allowed as a reference identifier.¶
The identities to be checked are set as follows:¶
######¶
We gratefully acknowledge everyone who contributed to the previous version of this document, [VERIFY].¶