RFC 6125

Representation and Verification of Domain-Based Application Service Identity within Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of Transport Layer Security (TLS)

๐Ÿ“… published March 2011, from ietf

RFC 6125: Representation and Verification of Domain-Based Application Service Identity within Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of Transport Layer Security (TLS) ๐ŸŽ€

Okay bestie, so this one is RFC 6125 ๐Ÿ’… It was written by P. Saint-Andre (Cisco) and J. Hodges (PayPal) and published in March 2011 under the IETF. It's a Standards Track document, which means it's official IETF stuff and not just vibes โœจ The ISSN is 2070-1721. The header doesn't list any obsoletes or updates, so it isn't replacing or changing anything else ๐Ÿฆ‹

Abstract ๐ŸŒธ

Lots of app tech lets two entities talk securely using PKIX certificates inside TLS ๐Ÿ” This doc is the rulebook for how to represent and verify the identity of application services in those interactions. Iconic. ๐Ÿ’–

Status of This Memo ๐Ÿ“œ

This is an Internet Standards Track document.

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further info on Internet Standards is in Section 2 of RFC 5741, so go check that if you're curious ๐Ÿงš

Info about the current status of this doc, any errata, and how to give feedback on it can be found at http://www.rfc-editor.org/info/rfc6125 ๐Ÿ“

Copyright (c) 2011 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 (http://trustee.ietf.org/license-info) as they stood on the date this doc was published. Please read these carefully, bestie, because they explain your rights and restrictions for this document ๐Ÿ“š Code Components pulled out of this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions, and they come with no warranty, as described in the Simplified BSD License โš ๏ธ

Table of Contents ๐Ÿ—‚๏ธ

   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  3
     1.1.  Motivation . . . . . . . . . . . . . . . . . . . . . . . .  3
     1.2.  Audience . . . . . . . . . . . . . . . . . . . . . . . . .  4
     1.3.  How to Read This Document  . . . . . . . . . . . . . . . .  4
     1.4.  Applicability  . . . . . . . . . . . . . . . . . . . . . .  5
     1.5.  Overview of Recommendations  . . . . . . . . . . . . . . .  5
     1.6.  Generalization from Current Technologies . . . . . . . . .  6
     1.7.  Scope  . . . . . . . . . . . . . . . . . . . . . . . . . .  7
       1.7.1.  In Scope . . . . . . . . . . . . . . . . . . . . . . .  7
       1.7.2.  Out of Scope . . . . . . . . . . . . . . . . . . . . .  7
     1.8.  Terminology  . . . . . . . . . . . . . . . . . . . . . . .  9
   2.  Naming of Application Services . . . . . . . . . . . . . . . . 13
     2.1.  Naming Application Services  . . . . . . . . . . . . . . . 13
     2.2.  DNS Domain Names . . . . . . . . . . . . . . . . . . . . . 14
     2.3.  Subject Naming in PKIX Certificates  . . . . . . . . . . . 15
       2.3.1.  Implementation Notes . . . . . . . . . . . . . . . . . 17
   3.  Designing Application Protocols  . . . . . . . . . . . . . . . 18
   4.  Representing Server Identity . . . . . . . . . . . . . . . . . 18
     4.1.  Rules  . . . . . . . . . . . . . . . . . . . . . . . . . . 18
     4.2.  Examples . . . . . . . . . . . . . . . . . . . . . . . . . 20
   5.  Requesting Server Certificates . . . . . . . . . . . . . . . . 21
   6.  Verifying Service Identity . . . . . . . . . . . . . . . . . . 21
     6.1.  Overview . . . . . . . . . . . . . . . . . . . . . . . . . 21
     6.2.  Constructing a List of Reference Identifiers . . . . . . . 22
       6.2.1.  Rules  . . . . . . . . . . . . . . . . . . . . . . . . 22
       6.2.2.  Examples . . . . . . . . . . . . . . . . . . . . . . . 24
     6.3.  Preparing to Seek a Match  . . . . . . . . . . . . . . . . 25
     6.4.  Matching the DNS Domain Name Portion . . . . . . . . . . . 26
       6.4.1.  Checking of Traditional Domain Names . . . . . . . . . 27
       6.4.2.  Checking of Internationalized Domain Names . . . . . . 27
       6.4.3.  Checking of Wildcard Certificates  . . . . . . . . . . 27
       6.4.4.  Checking of Common Names . . . . . . . . . . . . . . . 28
     6.5.  Matching the Application Service Type Portion  . . . . . . 28
       6.5.1.  SRV-ID . . . . . . . . . . . . . . . . . . . . . . . . 29
       6.5.2.  URI-ID . . . . . . . . . . . . . . . . . . . . . . . . 29
     6.6.  Outcome  . . . . . . . . . . . . . . . . . . . . . . . . . 29
       6.6.1.  Case #1: Match Found . . . . . . . . . . . . . . . . . 29
       6.6.2.  Case #2: No Match Found, Pinned Certificate  . . . . . 29
       6.6.3.  Case #3: No Match Found, No Pinned Certificate . . . . 30
       6.6.4.  Fallback . . . . . . . . . . . . . . . . . . . . . . . 30
   7.  Security Considerations  . . . . . . . . . . . . . . . . . . . 30
     7.1.  Pinned Certificates  . . . . . . . . . . . . . . . . . . . 30
     7.2.  Wildcard Certificates  . . . . . . . . . . . . . . . . . . 31
     7.3.  Internationalized Domain Names . . . . . . . . . . . . . . 32
     7.4.  Multiple Identifiers . . . . . . . . . . . . . . . . . . . 32
   8.  Contributors . . . . . . . . . . . . . . . . . . . . . . . . . 33
   9.  Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 33
   10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 34
     10.1. Normative References . . . . . . . . . . . . . . . . . . . 34
     10.2. Informative References . . . . . . . . . . . . . . . . . . 34
   Appendix A.  Sample Text . . . . . . . . . . . . . . . . . . . . . 40
   Appendix B.  Prior Art . . . . . . . . . . . . . . . . . . . . . . 42
     B.1.  IMAP, POP3, and ACAP (1999)  . . . . . . . . . . . . . . . 42
     B.2.  HTTP (2000)  . . . . . . . . . . . . . . . . . . . . . . . 43
     B.3.  LDAP (2000/2006) . . . . . . . . . . . . . . . . . . . . . 44
     B.4.  SMTP (2002/2007) . . . . . . . . . . . . . . . . . . . . . 47
     B.5.  XMPP (2004)  . . . . . . . . . . . . . . . . . . . . . . . 49
     B.6.  NNTP (2006)  . . . . . . . . . . . . . . . . . . . . . . . 50
     B.7.  NETCONF (2006/2009)  . . . . . . . . . . . . . . . . . . . 51
     B.8.  Syslog (2009)  . . . . . . . . . . . . . . . . . . . . . . 52
     B.9.  SIP (2010) . . . . . . . . . . . . . . . . . . . . . . . . 54
     B.10. SNMP (2010)  . . . . . . . . . . . . . . . . . . . . . . . 55
     B.11. GIST (2010)  . . . . . . . . . . . . . . . . . . . . . . . 55

1. Introduction โœจ

1.1. Motivation ๐Ÿ’ญ

Most of the visible Internet is services built on a client-server setup, where an interactive or automated client talks to an application service to fetch or upload info, chat with other entities, or get into a bigger network of services ๐ŸŒˆ When a client talks to an application service over Transport Layer Security [TLS] or Datagram Transport Layer Security [DTLS], it has some idea of who the server is (like "the website at example.com") while it's trying to set up a secure connection ๐Ÿ” Meanwhile, during TLS negotiation, the server shows its own version of the service's identity in the form of a public-key certificate issued by a certification authority (CA) under the Internet Public Key Infrastructure using X.509 [PKIX]. Informally, we can think of these as the client's "reference identity" and the server's "presented identity." These rough ideas get defined more precisely later in this doc with specific identifiers ๐Ÿงš Generally, the client needs to check that the server's presented identity matches its reference identity so it can authenticate the communication. Main character energy, honestly ๐Ÿ‘‘

Lots of application technologies follow this same pattern. Protocols have historically come up with their own rules for representing and verifying application service identity ๐Ÿ™ƒ Unfortunately, all these different approaches have caused some confusion for certification authorities, application developers, and protocol designers ๐Ÿ’€

So, to lock in secure procedures for implementing and deploying PKIX-based authentication, this document lays out recommended procedures for representing and verifying application service identity in certificates meant for application protocols that use TLS ๐Ÿซถ

1.2. Audience ๐ŸŽ€

The main audience is application protocol designers. They can point to this doc instead of making up their own rules for representing and verifying application service identity ๐Ÿง  The secondary audience is certification authorities, service providers, and client developers from technology communities that might reuse these recommendations when they're writing certificate issuance policies, generating certificate signing requests, or coding identity matching algorithms ๐Ÿ’…

1.3. How to Read This Document ๐Ÿ“–

Ngl, this doc is longer than the authors wanted it to be ๐Ÿ˜ญ But it had to be, because they needed to carefully define terminology, explain the underlying concepts, set the scope, and spell out the recommended behavior for both certification authorities and application software ๐Ÿ’– These sections are especially good for different people:

  • Protocol designers might want to first read the checklist in Section 3.
  • Certification authorities might want to first read the recommendations for representation of server identity in Section 4.
  • Service providers might want to first read the recommendations for requesting server certificates in Section 5.
  • Software implementers might want to first read the recommendations for verification of server identity in Section 6.

The sections on terminology (Section 1.8), naming of application services (Section 2), document scope (Section 1.7), and the like give useful background for the recommendations and guidelines in the sections above. You don't need them for a first read though ๐Ÿฆ‹

1.4. Applicability ๐ŸŒธ

This doc doesn't replace the rules for certificate issuance or validation in [PKIX]. So [PKIX] wins on any point that this doc also talks about ๐Ÿ‘‘ [PKIX] also covers any certificate topic this doc stays quiet on, including (but not limited to) certificate syntax, certificate extensions like name constraints and extended key usage, and handling of certification paths ๐Ÿงš

This doc only covers the name forms in the leaf "end entity" server certificate. It doesn't cover name forms in the chain of certificates used to validate the server certificate ๐Ÿ”— So, to make sure authentication actually works, application clients need to verify the entire certification path per [PKIX] ๐Ÿ™ˆ

This doc also doesn't replace the rules for verifying service identity in specs for existing application protocols published before this one, like the ones excerpted in Appendix B โœจ However, future specs can reference the procedures described here, and that includes updates to specs for existing application protocols if the relevant technology communities agree to it ๐Ÿซถ

1.5. Overview of Recommendations ๐Ÿงš

okay so this bit is basically a quick vibe check ๐Ÿซถ to help you get oriented before we dive in. Here's the big picture of what this doc is recommending.

For the main crowd, the application protocol designers ๐Ÿ’…, this document gives recommended procedures for representing and verifying application service identity inside PKIX certificates used with TLS. That's the core mission โœจ

For the secondary audiences (certification authorities, application service providers, and application client developers), the doc is basically encouraging everyone to coalesce on these practices, no cap ๐Ÿ”ฅ:

  • Move away from including and checking strings that look like domain names in the subject's Common Name. ๐Ÿ™ˆ
  • Move toward including and checking DNS domain names via the subjectAlternativeName extension designed for that purpose: dNSName. ๐Ÿ’–
  • Move toward including and checking even more specific subjectAlternativeName extensions where appropriate for using the protocol (e.g., uniformResourceIdentifier and the otherName form SRVName). ๐Ÿฆ‹
  • Move away from the issuance of so-called wildcard certificates (e.g., a certificate containing an identifier for *.example.com). ๐Ÿ’€

These suggestions aren't entirely consistent with all the practices that certification authorities, client developers, and service providers currently follow. ngl that's okay ๐ŸŒธ because they reflect the best aspects of current practices, and they're expected to get more widely adopted in the coming years โœจ

1.6. Generalization from Current Technologies ๐ŸŒˆ

this document is trying to generalize best practices from the many application technologies that already use PKIX certificates with TLS. literally so many protocols are in this group, and the list includes (but isn't limited to):

  • The Internet Message Access Protocol [IMAP] and the Post Office Protocol [POP3]; see also [USINGTLS] ๐Ÿ“ฌ
  • The Hypertext Transfer Protocol [HTTP]; see also [HTTP-TLS] ๐ŸŒ
  • The Lightweight Directory Access Protocol [LDAP]; see also [LDAP-AUTH] and its predecessor [LDAP-TLS] ๐Ÿ“‡
  • The Simple Mail Transfer Protocol [SMTP]; see also [SMTP-AUTH] and [SMTP-TLS] โœ‰๏ธ
  • The Extensible Messaging and Presence Protocol [XMPP]; see also [XMPP-OLD] ๐Ÿ’ฌ
  • The Network News Transfer Protocol [NNTP]; see also [NNTP-TLS] ๐Ÿ“ฐ
  • The NETCONF Configuration Protocol [NETCONF]; see also [NETCONF-SSH] and [NETCONF-TLS] โš™๏ธ
  • The Syslog Protocol [SYSLOG]; see also [SYSLOG-TLS] and [SYSLOG-DTLS] ๐Ÿงพ
  • The Session Initiation Protocol [SIP]; see also [SIP-CERTS] ๐Ÿ“ž
  • The Simple Network Management Protocol [SNMP]; see also [SNMP-TLS] ๐Ÿ“Š
  • The General Internet Signalling Transport [GIST] ๐Ÿ›ฐ๏ธ

However, as noted, this document does not supersede the rules for verifying service identity provided in the specifications for those application protocols. so don't skip those ๐Ÿ‘‘

1.7. Scope ๐ŸŽ€

1.7.1. In Scope ๐Ÿฆ‹

okay so this document only applies 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. It's giving very specific, and that's on purpose โœจ 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 ๐Ÿ”ฎ).

1.7.2. Out of Scope ๐Ÿ™…โ€โ™€๏ธ

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, which enables 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. that gives us fewer models to generalize from 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 shows that such certificates are a very small percentage (less than 1%) of issued certificates. furthermore, IP addresses aren't necessarily reliable identifiers for application services, because of private internets [PRIVATE], host mobility, multiple interfaces on a given host, Network Address Translators (NATs) giving a host different addresses from different locations on the network, the practice of grouping many hosts behind a single IP address, etc. most fundamentally, most users find DNS domain names way easier to work with than IP addresses, which is literally why the domain name system was designed in the first place ๐Ÿ’… we'd rather define best practices for the much more common use case than complicate the rules in this specification.

furthermore, we focus here on application service identities, not specific resources located at those services. so 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). it does not use them to communicate other aspects of a service, like a specific resource (via the URI "path" component) or parameters (via the URI "query" component) ๐Ÿงญ

we also don't 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 sometimes even employ PKIX certificates (e.g., IPsec [IPSEC]), their use cases can differ from those of TLS-based and DTLS-based application technologies. plus, application technologies have less experience with IPsec than with TLS, which makes it harder 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 aren't directly connected to the public Internet. so they can't 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 hasn't been certified by a third party in any way. and checking 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: ๐Ÿ“œ
    • What types or "classes" of certificates to issue, and whether to apply different policies for them (e.g., allow the wildcard character in certificates issued to individuals who have provided proof of identity, but don't allow the wildcard character in "Extended Validation" certificates [EV-CERTS]). ๐Ÿชช
    • Whether to issue certificates based on IP addresses (or some other form, such as relative domain names) in addition to fully qualified DNS domain names. ๐ŸŒ
    • Which identifiers to include (e.g., whether to include SRV-IDs or URI-IDs as defined in the body of this specification). ๐Ÿท๏ธ
    • How to certify or validate fully qualified DNS domain names and application service types. โœ…
    • How to certify or validate other kinds of information that might be included in a certificate (e.g., organization name). ๐Ÿง
  • 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 only care about the fact that the client needs to verify the identity of the entity it communicates with as a result of the resolution process. so the resolution process itself is out of scope for this specification ๐Ÿซถ

  • User interface issues. ๐Ÿ–ฅ๏ธ

in general, these issues are properly the responsibility of client software developers and the standards development organizations dedicated to particular application technologies (see, for example, [WSC-UI]) ๐Ÿ’–


1.8. Terminology โœจ

Okay so, "identity" is super vague and kinda slippery, which means application protocols can't really do much with it ๐Ÿ™ˆ So this spec defines a squad of more concrete terms to use instead ๐Ÿฆ‹

  • application service ๐ŸŒธ: 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.
  • application service provider ๐Ÿ’…: An organization or individual that hosts or deploys an application service.
  • application service type ๐ŸŽ€: A formal identifier for the application protocol used to provide a particular kind of application service at a domain. It typically takes the form of a Uniform Resource Identifier scheme [URI] or a DNS SRV Service [DNS-SRV].
  • attribute-type-and-value pair ๐Ÿงš: 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].
  • automated client ๐Ÿค–: A software agent or device that is not directly controlled by a human user.
  • delegated domain ๐Ÿซถ: 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. That host might be different from the server portion of the user's account name, like 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.
  • derived domain ๐Ÿฆ‹: A domain name or host name that a client has derived from the source domain in an automated fashion, for example by means of a [DNS-SRV] lookup.
  • identifier ๐Ÿ”ฅ: 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.
  • identifier type ๐Ÿ‘‘: A formally defined category of identifier that can be included in a certificate, and therefore can also be used for matching purposes. For conciseness and convenience, the spec defines the following identifier types of interest, which are based on those found in the PKIX specification [PKIX] and various PKIX extensions.
    • CN-ID = a Relative Distinguished Name (RDN) in the certificate subject field that contains one and only one attribute-type-and-value pair of type Common Name (CN), where the value matches the overall form of a domain name (informally, dot-separated letter-digit-hyphen labels). See [PKIX] and also [LDAP-SCHEMA].
    • DNS-ID = a subjectAltName entry of type dNSName. See [PKIX].
    • SRV-ID = a subjectAltName entry of type otherName whose name form is SRVName. See [SRVNAME].
    • URI-ID = a subjectAltName entry of type uniformResourceIdentifier whose value includes both (i) a "scheme" and (ii) a "host" component (or its equivalent) that matches the "reg-name" rule. The quoted terms represent the associated [ABNF] productions from [URI]. See [PKIX] and [URI].
  • interactive client ๐Ÿ’ป: 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".)
  • pinning ๐Ÿ“Œ: 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. 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 ๐ŸŒˆ: A short name for the Internet Public Key Infrastructure using X.509, defined in RFC 5280 [PKIX]. It comprises a profile of the X.509v3 certificate specifications and X.509v2 certificate revocation list (CRL) specifications for use in the Internet.
  • PKIX-based system โญ: A software implementation or deployed service that makes use of X.509v3 certificates and X.509v2 certificate revocation lists (CRLs).
  • PKIX certificate ๐Ÿ“: An X.509v3 certificate generated and employed in the context of PKIX.
  • presented identifier ๐ŸŒธ: An identifier that a server presents 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. If the server hosts more than one domain, the certificate might present distinct identifiers for each domain.
  • reference identifier ๐ŸŽฏ: An identifier, constructed from a source domain and optionally an application service type, that the client uses for matching purposes when examining presented identifiers.
  • source domain ๐Ÿก: The fully qualified DNS domain name that a client expects an application service to present in the certificate (for example, "www.example.com"). It is 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.
  • subjectAltName entry ๐Ÿง: An identifier placed in a subjectAltName extension.
  • subjectAltName extension ๐Ÿ’œ: A standard PKIX certificate extension [PKIX] that enables identifiers of various types to be bound to the certificate subject. This happens in addition to, or in place of, identifiers that may be embedded within or provided as a certificate's subject field.
  • 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]).
  • subject name ๐Ÿ—‚๏ธ: In an overall sense, a subject's name or names 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]).
  • TLS client ๐Ÿฆ„: 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.
  • TLS server ๐Ÿฐ: 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]. Those 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 RFC 2119 [KEYWORDS]. ๐Ÿ“–โœจ


2. Naming of Application Services โœจ

This section talks about naming application services on the Internet, and then gives a quick tutorial on subject naming in PKIX ๐ŸŽ€

2.1. Naming Application Services ๐Ÿ’–

okay so this spec assumes the name of an application service is based on a DNS domain name (like "example.com") ๐ŸŒธ, sometimes with an application service type added on top (like "the IMAP server at example.com") โœจ.

From the client or user's side, some names are direct ๐Ÿ’… because a human hands them over directly (through runtime input, prior configuration, or explicitly accepting a client communication attempt). Other names are indirect ๐Ÿ” because the client resolves them automatically from user input, like turning a source name into a target name with DNS SRV or NAPTR records. This split matters most for certificate consumption, specifically the verification stuff this document talks about ๐ŸŽ€.

From the service's side, some names are unrestricted ๐Ÿฆ‹ because they can be used for any type of service. A certificate could be reused for both the HTTP service and the IMAP service at example.com, and that's totally fine. Other names are restricted ๐Ÿ”’ because they only work for one type of service, like a special-purpose certificate that's only good for an IMAP service. This split matters most for certificate issuance ๐Ÿ“œ.

So the identifier types we care about sort out like this ๐Ÿ‘‘:

  • A CN-ID is direct and unrestricted.
  • A DNS-ID is direct and unrestricted.
  • An SRV-ID can be either direct or (more typically) indirect, and is restricted.
  • A URI-ID is direct and restricted.

Here's the taxonomy in table form ๐Ÿ“:

+-----------+-----------+---------------+
|           |  Direct   |  Restricted   |
+-----------+-----------+---------------+
|  CN-ID    |  Yes      |  No           |
+-----------+-----------+---------------+
|  DNS-ID   |  Yes      |  No           |
+-----------+-----------+---------------+
|  SRV-ID   |  Either   |  Yes          |
+-----------+-----------+---------------+
|  URI-ID   |  Yes      |  Yes          |
+-----------+-----------+---------------+
โš ๏ธ bestie, these distinctions really matter! When you're building software, deploying services, or issuing certificates for secure PKIX-based authentication, keep them in mind. Best practices are a little different for application server implementations, application client implementations, application service providers, and certification authorities ๐Ÿ™ˆ.

Ideally, protocol specs that reference this document will say which identifiers are mandatory-to-implement for servers and clients, which ones issuers ought to support, and which ones application service providers ought to request ๐Ÿซถ. Since those requirements vary between applications, there's no one-size-fits-all rule. You can't just say that every software implementation, service provider, and CA for every application protocol needs to use or support DNS-IDs as a baseline for interoperability ๐Ÿ˜ญ.

That said, it's preferable for each application protocol to define at least a baseline that applies to the community of developers, service providers, and CAs actively using or supporting that tech. One community, the CA/Browser Forum, already codified a baseline like this for "Extended Validation Certificates" in [EV-CERTS] ๐Ÿ‘‘โœจ.

2.2. DNS Domain Names ๐ŸŒˆ

For this specification, the name of an application service is (or is based on) a DNS domain name that fits one of these forms ๐Ÿ’œ:

  1. A "traditional domain name", meaning a fully qualified DNS domain name or "FQDN" (see [DNS-CONCEPTS]) where every label is an "LDH label" as described in [IDNA-DEFS]. Informally, these labels are limited to [US-ASCII] letters, digits, and the hyphen, and the hyphen isn't allowed in the first character position. There are extra qualifications too (check the referenced specs for the details), but they don't matter for this specification ๐Ÿงš.
  2. An "internationalized domain name", meaning a DNS domain name that follows the overall shape of a domain name (informally, dot-separated letter-digit-hyphen labels) but has at least one label with properly encoded Unicode code points outside the traditional US-ASCII range ๐ŸŒ. It has at least one U-label or A-label, and otherwise can be any mix of NR-LDH labels, A-labels, or U-labels, as described in [IDNA-DEFS] and its associated documents ๐Ÿ’….

2.3. Subject Naming in PKIX Certificates ๐ŸŽ€

In theory, the Internet Public Key Infrastructure using X.509 [PKIX] uses the global directory service model defined in [X.500] and [X.501] ๐Ÿง . In that model, info lives in a directory information base (DIB), and entries in the DIB are organized into a hierarchy called the directory information tree (DIT) ๐ŸŒณ. An object or alias entry in that hierarchy is a set of attributes (each with a defined type and one or more values) and is uniquely identified by a Distinguished Name (DN) ๐Ÿ”‘. The DN of an entry is built by combining the Relative Distinguished Names of its superior entries (all the way down to the root of the DIT) with one or more specially nominated attributes of the entry itself. Those together make up the entry's Relative Distinguished Name (RDN), so called because it's relative to the DNs of the superior entries ๐Ÿ’ซ. The entry closest to the root is sometimes called the "most significant" entry, and the one farthest from the root is sometimes called the "least significant" entry ๐ŸŒฑ. An RDN is a set (an unordered group) of attribute-type-and-value pairs (see also [LDAP-DN]), and each one 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 (like DNs and RDNs) to identify entities, but those certificates aren't 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's perfectly acceptable for the subject field to be empty, as long as the certificate has a subject alternative name ("subjectAltName") extension with at least one subjectAltName entry. The subjectAltName extension lets various identities get bound to the subject (see Section 4.2.1.6 of [PKIX]) ๐ŸŒŸ. The 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 in the subject field (that's a CN-ID), and/or by one of these identifier types inside subjectAltName entries ๐Ÿ’œ:

  • DNS-ID
  • SRV-ID
  • URI-ID

A lot of existing certificates use a CN-ID in the subject field to represent a fully qualified DNS domain name. For example, here are three subject names where the Common Name attribute holds a string that looks like 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 isn't strongly typed ๐Ÿ™ˆ. A Common Name might hold a human-friendly string for the service instead of something that looks like a fully qualified DNS domain name. (A certificate with a single Common Name like that will typically also 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 and another common name attribute with a human-friendly string ๐ŸŒธ:

CN=A Free Chat Service,CN=im.example.org,O=Example Org,C=GB

Generally, this specification recommends and prefers subjectAltName entries (DNS-ID, SRV-ID, URI-ID, etc.) over the subject field (CN-ID) wherever possible, as the following sections explain in more detail โœจ. That said, specifications that reuse this one can legitimately keep encouraging support for the CN-ID identifier type if they have good reasons, like backward compatibility with deployed infrastructure (see, for example, [EV-CERTS]) ๐Ÿซถ.

2.3.1. Implementation Notes ๐Ÿ› ๏ธ

Confusion sometimes pops up because the hierarchical info in a certificate can be rendered or encoded in different ways ๐Ÿ˜ตโ€๐Ÿ’ซ.

Certificates are binary objects, encoded using the Distinguished Encoding Rules (DER) specified in [X.690] ๐Ÿ”ข. But some implementations generate displayable (a.k.a. printable) renderings of the certificate issuer, subject field, and subjectAltName extension. Those renderings turn the DER-encoded sequences into a "string representation" before displaying them ๐Ÿ–ฅ๏ธ. A certificate subject field (type Name [X.509], same as a Distinguished Name (DN) [X.501]) is an ordered sequence, so order is usually preserved in subject string representations. Still, the two most common subject (and DN) string representations differ: one goes left-to-right and the other goes right-to-left ๐Ÿ”„. A Relative Distinguished Name (RDN), though, is an unordered group of attribute-type-and-value pairs. So the string representation of an RDN can differ from its canonical DER encoding, and the order of attribute-type-and-value pairs can vary in RDN string representations or display orders across implementations ๐ŸŒ€. On top of that, various specs refer to the order of RDNs in DNs or certificate subject fields using terms tied to an information hierarchy (which may or may not actually exist), like "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 cut down on the confusion, this specification avoids those terms and uses the terms provided under Section 1.8 instead ๐Ÿ’…. In particular, we don't use the term "(most specific) Common Name field in the subject field" from [HTTP-TLS]. Instead, we say 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. That removes the possibility of an RDN holding multiple AVAs (Attribute Value Assertions) of type CN, where one of them could be considered "most specific" ๐ŸŽฏ.

Finally, some folks think the order of RDNs within a subject field has meaning, but in practice that rule often isn't followed ๐Ÿคทโ€โ™€๏ธ. An AVA of type CN is considered valid at any position within the subject field ๐Ÿ’–.

3. Designing Application Protocols โœจ

okay bestie, this section is basically a checklist for application protocol designers ๐Ÿ’… use it whenever you're reusing the recommendations from this doc ๐ŸŽ€

  • Does your technology use DNS SRV records to resolve the DNS domain names of application services? If so, consider recommending or requiring support for the SRV-ID identifier type in PKIX certificates issued and used in your technology community. (Note that many existing application technologies use DNS SRV records to resolve the DNS domain names of application services, but do not rely on representations of those records in PKIX certificates by means of SRV-IDs as defined in [SRVNAME].)
  • Does your technology use URIs to identify application services? If so, consider recommending or requiring support for the URI-ID identifier type. (Note that many existing application technologies use URIs to identify application services, but do not rely on representation of those URIs in PKIX certificates by means of URI-IDs.)
  • Does your technology need to use DNS domain names in the Common Name of certificates for the sake of backward compatibility? If so, consider recommending support for the CN-ID identifier type as a fallback.
  • Does your technology need to allow the wildcard character in DNS domain names? If so, consider recommending support for wildcard certificates, and specify exactly where the wildcard character is allowed to occur (e.g., only the complete left-most label of a DNS domain name).

Sample text is provided under Appendix A. ๐ŸŒธ

4. Representing Server Identity ๐Ÿฆ‹

this section is all about the rules and guidelines for certificate issuers, so pay attention ๐Ÿ‘‘

4.1. Rules ๐Ÿ’–

when a certification authority issues a certificate based on the fully qualified DNS domain name where the application service provider will provide the relevant application, these rules apply to how application service identities get represented. heads up that some of these rules stack on each other and interact in important ways, which we'll see later in this doc โœจ

  1. The certificate SHOULD include a "DNS-ID" if possible as a baseline for interoperability.
  2. If the service using the certificate deploys a technology for which the relevant specification stipulates that certificates ought to include identifiers of type SRV-ID (e.g., this is true of [XMPP]), then the certificate SHOULD include an SRV-ID.
  3. If the service using the certificate deploys a technology for which the relevant specification stipulates that certificates ought to include identifiers of type URI-ID (e.g., this is true of [SIP] as specified by [SIP-CERTS], but not true of [HTTP] since [HTTP-TLS] does not describe usage of a URI-ID for HTTP services), then the certificate SHOULD include a URI-ID. The scheme SHALL be that of the protocol associated with the application service type and the "host" component (or its equivalent) SHALL be the fully qualified DNS domain name of the service. A specification that reuses this one MUST specify which URI schemes are to be considered acceptable in URI-IDs contained in PKIX certificates used for the application protocol (e.g., "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).
  4. The certificate MAY include other application-specific identifiers for types that were defined before publication of [SRVNAME] (e.g., XmppAddr for [XMPP]) or for which service names or URI schemes do not exist; however, such application-specific identifiers are not applicable to all application technologies and therefore are out of scope for this specification.
  5. Even though many deployed clients still check for the CN-ID within the certificate subject field, certification authorities are encouraged to migrate away from issuing certificates that represent the server's fully qualified DNS domain name in a CN-ID. Therefore, the certificate SHOULD NOT include a CN-ID unless the certification authority issues the certificate in accordance with a specification that reuses this one and that explicitly encourages continued support for the CN-ID identifier type in the context of a given application technology.
  6. The certificate MAY contain more than one DNS-ID, SRV-ID, or URI-ID but SHOULD NOT contain more than one CN-ID, as further explained under Section 7.4.
  7. Unless a specification that reuses this one allows continued support for the wildcard character *, 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. ๐Ÿ™ˆ

4.2. Examples ๐Ÿงš

consider a simple website at www.example.com, which is not discoverable via DNS SRV lookups. because HTTP doesn't 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. ๐Ÿ’ฌ

5. Requesting Server Certificates ๐Ÿ“

this section is for service providers, and it's all about what to put 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) wants 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 doesn't 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]). ๐Ÿ’…

6. Verifying Service Identity ๐Ÿ”ฅ

this section is for client software implementers, and it covers the algorithms for verifying application service identity ๐Ÿง 

6.1. Overview ๐Ÿฆ‹

at a high level, the client verifies the application service's identity by doing the actions listed below (which are defined in the following subsections of this document):

  1. The client constructs a list of acceptable reference identifiers based on the source domain and, optionally, the type of service to which the client is connecting.
  2. The server provides its identifiers in the form of a PKIX certificate.
  3. The client checks each of its reference identifiers against the presented identifiers for the purpose of finding a match.
  4. When checking a reference identifier against a presented identifier, the client matches the source domain of the identifiers and, optionally, their application service type.

naturally, in addition to checking identifiers, a client might complete further checks to make sure the server is authorized to provide the requested service. however, that checking isn't about verifying the application service identity presented in a certificate, so methods for doing it (e.g., consulting local policy information) are out of scope for this document. ๐Ÿ™ƒ

6.2. Constructing a List of Reference Identifiers ๐ŸŽ€

6.2.1. Rules

Okay bestie, first things first ๐Ÿ’… The client MUST construct a list of acceptable reference identifiers, and it MUST do that independently of whatever identifiers the service presents. No peeking at the server's homework and copying it ๐Ÿ™…โ€โ™€๏ธโœจ

The inputs the client uses to build that list could be a URI a user typed into an interface (like an HTTPS URL for a website), configured account info (like 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 makes a browser grab a media object or script, or just some combo of info that can give you a source domain and an application service type ๐Ÿงš

The client might need to pull the source domain and application service type out of what it got. The extracted data MUST include only information that can be securely parsed out of the inputs (for example, 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 (for example, 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 (for example, 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 ๐Ÿšจ

Example: Given an input URI of <sips:alice@example.net>, a client would derive the application service type "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 (for example, a host name or domain name discovered through DNS resolution of the source domain). This rule is super important because only a match between the user inputs and a presented identifier lets the client 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 SHOULD include a DNS-ID. A reference identifier of type DNS-ID can be directly constructed from a fully qualified DNS domain name that is (a) contained in or securely derived from the inputs (i.e., the source domain), or (b) explicitly associated with the source domain by means of user configuration (i.e., a derived domain). ๐ŸŒธ
  • If a server for the application service type is typically discovered by means of DNS SRV records, then the list SHOULD include an SRV-ID. ๐Ÿฆ‹
  • If a server for the application service type is typically associated with a URI for security purposes (i.e., a formal protocol document specifies the use of URIs in server certificates), then the list SHOULD include a URI-ID. ๐Ÿซถ
  • 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 (for example, 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. ๐ŸŽฏ

Implementation Note: It is highly likely that implementers of client software will need to support CN-IDs for the foreseeable future, because certificates containing CN-IDs are so widely deployed. Implementers are advised to monitor the state of the art with regard to certificate issuance policies and migrate away from support CN-IDs in the future if possible. ๐Ÿ™ˆ
Implementation Note: The client does not need to construct the foregoing identifiers in the actual formats found in a certificate (for example, as ASN.1 types); it only needs to construct the functional equivalent of such identifiers for matching purposes. ๐Ÿง 
Security Warning: A client MUST NOT construct a reference identifier corresponding to Relative Distinguished Names (RDNs) other than those of type Common Name and MUST NOT check for RDNs other than those of type Common Name in the presented identifiers. ๐Ÿ’€๐Ÿšซ

6.2.2. Examples

Time for the fun part, the real-life examples ๐Ÿ“

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]). Iconic minimalism ๐Ÿ“ž๐Ÿฆ‹

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]). Three IDs, zero drama ๐Ÿ‘‘


6.3. Preparing to Seek a Match

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. ๐Ÿ”๐Ÿ’–

Implementation Note: A client might be configured to perform multiple searches, i.e., to match more than one reference identifier. Although such behavior is not forbidden by this specification, rules for matching multiple reference identifiers are a matter for implementation or future specification. ๐Ÿงฉ
Security Warning: 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. ๐Ÿšจ๐Ÿ˜ญ

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:

  • A reference identifier of type DNS-ID does not include an application service type portion and thus can be used directly as the DNS domain name for comparison purposes. As an example, a DNS-ID of www.example.com would result in a DNS domain name portion of www.example.com. ๐ŸŒธ
  • A reference identifier of type CN-ID also does not include an application service type portion and thus can be used directly as the DNS domain name for comparison purposes. As previously mentioned, this document specifies that a CN-ID always contains a string whose form matches that of a DNS domain name (thus differentiating a CN-ID from a Common Name containing a human-friendly name). ๐Ÿงพ
  • For a reference identifier of type SRV-ID, the DNS domain name portion is the Name and the application service type portion is the Service. As an example, an SRV-ID of _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]). ๐Ÿช„
  • For a reference identifier of type URI-ID, the DNS domain name portion is the "reg-name" part of the "host" component (or its equivalent) and the application service type portion is the application service type associated with the scheme name matching the [ABNF] "scheme" rule from [URI] (not including the ':' separator). As previously mentioned, this document specifies that a URI-ID always contains a "host" component (or its equivalent) containing a "reg-name". (Matching only the "reg-name" rule from [URI] limits verification to DNS domain names, thereby differentiating a URI-ID from a uniformResourceIdentifier entry that contains an IP address or a mere host name, or that does not contain a "host" component at all.) Furthermore, note that extraction of the "reg-name" might necessitate normalization of the URI (as explained in [URI]). As an example, a URI-ID of 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. ๐ŸŽ€

6.4. Matching the DNS Domain Name Portion โœจ

okay bestie, the client MUST match the DNS domain name portion of a reference identifier using the rules below ๐Ÿ’– (and it SHOULD also check the application service type, see Section 6.5 ๐ŸŽ€). the rules change depending on whether the domain is a "traditional domain name" or an "internationalized domain name" (as defined under Section 2.2 ๐ŸŒธ). plus, to handle clients that support presented identifiers with the wildcard character * ๐Ÿฆ‹, we add a supplemental rule for so-called "wildcard certificates" ๐Ÿงš. last but not least, we also spell out when it's okay to check the "CN-ID" identifier type ๐Ÿ‘‘.

6.4.1. Checking of Traditional Domain Names ๐Ÿ’…

if the DNS domain name portion of a reference identifier is a "traditional domain name", then matching is done by comparing the set of domain name labels with a case-insensitive ASCII comparison, as clarified by [DNS-CASE] ๐Ÿซถ (for example, 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 a match, except as supplemented by the rule about checking of wildcard labels (Section 6.4.3) ๐Ÿ”ฅ.

6.4.2. Checking of Internationalized Domain Names ๐ŸŒˆ

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 ๐Ÿ“. per [IDNA-PROTO], A-labels MUST be compared as case-insensitive ASCII ๐Ÿ’œ. each label MUST match, in order, for the domain names to be considered a 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) ๐Ÿ™ˆ.

6.4.3. Checking of Wildcard Certificates ๐Ÿฆ‹

a client using these 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 security stuff about wildcard certificates, check out Section 7.2 ๐Ÿ”.

if a client matches the reference identifier against a presented identifier whose DNS domain name portion contains the wildcard character *, these rules apply:

  1. the client SHOULD NOT attempt to match a presented identifier in which the wildcard character makes up a label other than the left-most label (for example, do not match bar.*.example.net) ๐Ÿ™…โ€โ™€๏ธ.
  2. if the wildcard character is the only character of the left-most label in the presented identifier, the client SHOULD NOT compare against anything but the left-most label of the reference identifier (for example, *.example.com would match foo.example.com but not bar.foo.example.com or example.com) ๐Ÿ’€.
  3. the client MAY match a presented identifier in which the wildcard character is not the only character of the label (for example, baz*.example.net, *baz.example.net and b*z.example.net would be taken to match baz1.example.net, foobaz.example.net and buzz.example.net, respectively) ๐Ÿญ. however, the client SHOULD NOT attempt to match a presented identifier where the wildcard character is embedded within an A-label or U-label [IDNA-DEFS] of an internationalized domain name [IDNA-PROTO] ๐Ÿšซ.

6.4.4. Checking of Common Names ๐Ÿ™ˆ

okay so, 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 the client supports ๐Ÿ›‘.

so, if and only if the presented identifiers do NOT include a DNS-ID, SRV-ID, URI-ID, or any application-specific identifier types the client supports, then the client MAY, as a last resort, check for a string whose form matches a fully qualified DNS domain name in a Common Name field of the subject field (that's the 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 ๐ŸŽ€.

6.5. Matching the Application Service Type Portion ๐Ÿงš

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. ๐Ÿค“

6.5.1. SRV-ID ๐Ÿฆ‹

the application service name portion of an SRV-ID (for example, 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]), so it does not need to be included in any comparison ๐Ÿซถ.

6.5.2. URI-ID ๐ŸŒˆ

the scheme name portion of a URI-ID (for example, sip) MUST be matched in a case-insensitive manner, in accordance with [URI] ๐Ÿ’œ. note that the : character is a separator between the scheme name and the rest of the URI, so it does not need to be included in any comparison ๐Ÿ“.

6.6. Outcome ๐Ÿ‘‘

the outcome of the matching procedure is one of the following cases ๐Ÿ’–.

6.6.1. Case #1: Match Found ๐ŸŽ‰

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 โœ….

6.6.2. Case #2: No Match Found, Pinned Certificate ๐Ÿ“Œ

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.8), AND the presented certificate matches the pinned certificate (including the context as described under Section 7.1), then the service identity check has succeeded ๐Ÿฆ‹.

6.6.3. Case #3: No Match Found, No Pinned Certificate ๐Ÿ™…โ€โ™€๏ธ

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 ๐Ÿ’….

6.6.4. Fallback ๐Ÿšจ

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 ๐Ÿซถ.

Security Warning: Some interactive clients give advanced users the option of proceeding with acceptance despite the identity mismatch, thereby "pinning" the certificate to one of the reference identifiers in the list constructed by the client for this communication attempt. Although this behavior can be appropriate in certain specialized circumstances, in general it ought to be exposed only to advanced users. Even then it needs to be handled with extreme caution, for example by first encouraging even an advanced user to terminate the communication attempt and, if the advanced user chooses to proceed anyway, by forcing the user to view the entire certification path and only then allowing the user to pin the certificate (on a temporary or permanent basis, at the user's option). ๐Ÿ˜ฑ๐Ÿ’€

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 it MUST enable the behavior by default โš™๏ธ.

7. Security Considerations ๐Ÿ”

7.1. Pinned Certificates ๐Ÿ“Œ

as defined under Section 1.8, 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, even though the certificate contains some other DNS domain name (for example, 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) ๐Ÿง ๐Ÿ’œ.

7.2. Wildcard Certificates ๐Ÿงš

okay bestie, listen ๐Ÿ‘‚ this document says the wildcard character '*' SHOULD NOT be included in presented identifiers, but application clients MAY still check for it ๐Ÿ’… mostly so older deployed stuff keeps working ๐Ÿซถ. so the rules here are way stricter than a lot of existing app tech (the ones excerpted in Appendix B) ๐Ÿ”ฅ. and there are a few real security reasons for tightening things up:

  • wildcard certs automatically vouch for literally every host name in their domain ๐Ÿ‘€. super convenient for admins, but it also means they can vouch for a rogue or buggy host ๐Ÿ’€. see [Defeating-SSL] (beginning at slide 91) and [HTTPSbytes] (slides 38-40) for the receipts ๐Ÿ“ธ.
  • the specs for existing app tech are kinda vague and inconsistent about where the wildcard is allowed to sit ๐Ÿ˜ญ. like, is it allowed to be:
    • only the complete left-most label (e.g., *.example.com)
    • some fragment of the left-most label (e.g., fo*.example.com, f*o.example.com, or *oo.example.com)
    • all or part of a label other than the left-most label (e.g., www.*.example.com or www.foo*.example.com)
    • all or part of a label that identifies a so-called "public suffix" (e.g., *.co.uk or *.com)
    • included more than once in a given label (e.g., f*b*r.example.com
    • included as all or part of more than one label (e.g., *.*.example.com)

this mess can open up exploitable differences in how identity checking works across different clients ๐Ÿ™ˆ, and it makes the checking algorithms super complicated and slow ๐ŸŒ.

  • there's no spec that says how the wildcard character can be tucked inside the A-labels or U-labels [IDNA-DEFS] of an internationalized domain name [IDNA-PROTO] ๐ŸŒธ. so implementations are strongly discouraged from including or trying to check for a wildcard embedded inside an A-label or U-label (like xn--kcry6tjko*.example.org) ๐Ÿ™…โ€โ™€๏ธ. BUT, a presented domain name identifier MAY contain the wildcard character as long as it takes up the entire left-most label spot, and all the remaining labels are valid NR-LDH labels, A-labels, or U-labels (e.g., *.xn--kcry6tjko.example.org) โœจ.

all that said, specs that reuse this one can legitimately keep supporting the wildcard character if they've got good reasons, like backward compatibility with deployed infrastructure (see, for example, [EV-CERTS]) ๐ŸŽ€. no judgment, just context ๐Ÿ’–.

7.3. Internationalized Domain Names ๐ŸŒˆ

okay so letting internationalized domain names in can lead to visually similar characters, the so-called "confusable" ones, showing up in certificates ๐Ÿ‘€. like two things that look identical but aren't ๐Ÿ˜ญ. for more on that, check out [IDNA-DEFS] ๐Ÿ”.

7.4. Multiple Identifiers ๐Ÿฆ‹

so a single application service might be reachable under multiple DNS domain names for all sorts of reasons ๐ŸŒธ, and one deployment might serve multiple domains (think so-called "virtual hosting" setups) ๐Ÿ . here's the tea: in the default TLS handshake, the client can't say which DNS domain name it wants to talk to ๐Ÿ™ƒ, and the TLS server only hands back one certificate for itself ๐ŸŽŸ๏ธ. so unless there's a TLS extension, the usual workaround for mapping one service to multiple DNS domain names is to cram every domain name into a single certificate ๐Ÿซ .

a newer approach, formally specified in [TLS-EXT], is for the client to use the TLS "Server Name Indication" (SNI) extension when it sends the client_hello message ๐Ÿ’…. it basically says "hey, this is the DNS domain name I want or expect from you" ๐Ÿ“ฃ. then the service can return the right certificate in its Certificate message, and that certificate can represent just one DNS domain name ๐Ÿง. main character energy โœจ.

so this spec allows multiple DNS-IDs, SRV-IDs, or URI-IDs in a certificate to keep that old workaround working ๐Ÿซถ. but it explicitly discourages multiple CN-IDs ๐Ÿ™…โ€โ™€๏ธ. ideally we'd forbid multiple CN-IDs totally, but there are a few reasons this spec says they SHOULD NOT (instead of MUST NOT) be included, for now ๐Ÿฅน:

  • at least one big technology community explicitly allows multiple CN-IDs [EV-CERTS] ๐Ÿ“š.
  • at least one significant certification authority is known to issue certificates with multiple CN-IDs ๐Ÿ›๏ธ.
  • lots of service providers think multiple CN-IDs are necessary in virtual hosting setups, because at least one widely deployed operating system doesn't support the SNI extension yet ๐Ÿ’ป.

the hope is that the recommendation about multiple CN-IDs can get tightened up later on ๐ŸŒŸ๐Ÿคž.


8. Contributors ๐ŸŽ€

the following individuals made important contributions to the text of this document: Shumon Huque, RL 'Bob' Morgan, and Kurt Zeilenga ๐Ÿ’–.

9. Acknowledgements ๐Ÿซถ

the editors and contributors want to thank these amazing people for their feedback and suggestions ๐Ÿฅฐ: Bernard Aboba, Richard Barnes, Uri Blumenthal, Nelson Bolyard, Kaspar Brand, Anthony Bryan, Scott Cantor, Wan-Teh Chang, Bil Corry, Dave Cridland, Dave Crocker, Cyrus Daboo, Charles Gardiner, Philip Guenther, Phillip Hallam-Baker, Bruno Harbulot, Wes Hardaker, David Harrington, Paul Hoffman, Love Hornquist Astrand, Henry Hotz, Russ Housley, Jeffrey Hutzelman, Cullen Jennings, Simon Josefsson, Geoff Keating, John Klensin, Scott Lawrence, Matt McCutchen, Alexey Melnikov, Subramanian Moonesamy, Eddy Nigg, Ludwig Nussel, Joe Orton, Tom Petch, Yngve N. Pettersen, Tim Polk, Robert Relyea, Eric Rescorla, Pete Resnick, Martin Rex, Joe Salowey, Stefan Santesson, Jim Schaad, Rob Stradling, Michael Stroeder, Andrew Sullivan, Peter Sylvester, Martin Thomson, Paul Tiemann, Sean Turner, Nicolas Williams, Dan Wing, Dan Winship, and Stefan Winter ๐Ÿ‘‘.

thanks also to Barry Leiba and Ben Campbell for their reviews on behalf of the Security Directorate and the General Area Review Team, respectively ๐Ÿ™Œ.

the responsible Area Director was Alexey Melnikov ๐Ÿ’….

10. References ๐Ÿ“š

10.1. Normative References ๐Ÿ”

  • [DNS-CONCEPTS] Mockapetris, P., "Domain names - concepts and facilities", STD 13, RFC 1034, November 1987.
  • [DNS-SRV] Gulbrandsen, A., Vixie, P., and L. Esibov, "A DNS RR for specifying the location of services (DNS SRV)", RFC 2782, February 2000.
  • [IDNA-DEFS] Klensin, J., "Internationalized Domain Names for Applications (IDNA): Definitions and Document Framework", RFC 5890, August 2010.
  • [IDNA-PROTO] Klensin, J., "Internationalized Domain Names in Applications (IDNA): Protocol", RFC 5891, August 2010.
  • [KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
  • [LDAP-DN] Zeilenga, K., Ed., "Lightweight Directory Access Protocol (LDAP): String Representation of Distinguished Names", RFC 4514, June 2006.
  • [PKIX] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, "Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 5280, May 2008.
  • [SRVNAME] Santesson, S., "Internet X.509 Public Key Infrastructure Subject Alternative Name for Expression of Service Name", RFC 4985, August 2007.
  • [URI] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, January 2005.

10.2. Informative References ๐Ÿ“šโœจ

okay so these are the informative ones, meaning the extra reading that backs up the main doc ๐Ÿค“ we're not re-deriving everything from scratch, we're pointing at the sources. here's the full list, every single one, no cuts ๐Ÿ’…

  • [ABNF] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, January 2008.
  • [DNS-CASE] Eastlake 3rd, D., "Domain Name System (DNS) Case Insensitivity Clarification", RFC 4343, January 2006.
  • [DNSSEC] Arends, R., Austein, R., Larson, M., Massey, D., and S. Rose, "DNS Security Introduction and Requirements", RFC 4033, March 2005.
  • [DTLS] Rescorla, E. and N. Modadugu, "Datagram Transport Layer Security", RFC 4347, April 2006.
  • [Defeating-SSL] Marlinspike, M., "New Tricks for Defeating SSL in Practice", BlackHat DC, February 2009, <http://www.blackhat.com/presentations/bh-dc-09/Marlinspike/BlackHat-DC-09-Marlinspike-Defeating-SSL.pdf>.
  • [EMAIL-SRV] Daboo, C., "Use of SRV Records for Locating Email Submission/Access Services", RFC 6186, March 2011.
  • [EV-CERTS] CA/Browser Forum, "Guidelines For The Issuance And Management Of Extended Validation Certificates", October 2009, <http://www.cabforum.org/Guidelines_v1_2.pdf>.
  • [GIST] Schulzrinne, H. and R. Hancock, "GIST: General Internet Signalling Transport", RFC 5971, October 2010.
  • [HTTP] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
  • [HTTP-TLS] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000.
  • [HTTPSbytes] Sokol, J. and R. Hansen, "HTTPS Can Byte Me", BlackHat Abu Dhabi, November 2010, <https://media.blackhat.com/bh-ad-10/Hansen/Blackhat-AD-2010-Hansen-Sokol-HTTPS-Can-Byte-Me-slides.pdf>.
  • [IDNA2003] Faltstrom, P., Hoffman, P., and A. Costello, "Internationalizing Domain Names in Applications (IDNA)", RFC 3490, March 2003.
  • [IMAP] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1", RFC 3501, March 2003.
  • [IP] Postel, J., "Internet Protocol", STD 5, RFC 791, September 1981.
  • [IPSEC] Kent, S. and K. Seo, "Security Architecture for the Internet Protocol", RFC 4301, December 2005.
  • [IPv6] Deering, S. and R. Hinden, "Internet Protocol, Version 6 (IPv6) Specification", RFC 2460, December 1998.
  • [LDAP] Sermersheim, J., "Lightweight Directory Access Protocol (LDAP): The Protocol", RFC 4511, June 2006.
  • [LDAP-AUTH] Harrison, R., "Lightweight Directory Access Protocol (LDAP): Authentication Methods and Security Mechanisms", RFC 4513, June 2006.
  • [LDAP-SCHEMA] Sciberras, A., Ed., "Lightweight Directory Access Protocol (LDAP): Schema for User Applications", RFC 4519, June 2006.
  • [LDAP-TLS] Hodges, J., Morgan, R., and M. Wahl, "Lightweight Directory Access Protocol (v3): Extension for Transport Layer Security", RFC 2830, May 2000.
  • [NAPTR] Mealling, M., "Dynamic Delegation Discovery System (DDDS) Part Three: The Domain Name System (DNS) Database", RFC 3403, October 2002.
  • [NETCONF] Enns, R., Ed., "NETCONF Configuration Protocol", RFC 4741, December 2006.
  • [NETCONF-SSH] Wasserman, M. and T. Goddard, "Using the NETCONF Configuration Protocol over Secure SHell (SSH)", RFC 4742, December 2006.
  • [NETCONF-TLS] Badra, M., "NETCONF over Transport Layer Security (TLS)", RFC 5539, May 2009.
  • [NNTP] Feather, C., "Network News Transfer Protocol (NNTP)", RFC 3977, October 2006.
  • [NNTP-TLS] Murchison, K., Vinocur, J., and C. Newman, "Using Transport Layer Security (TLS) with Network News Transfer Protocol (NNTP)", RFC 4642, October 2006.
  • [OCSP] Myers, M., Ankney, R., Malpani, A., Galperin, S., and C. Adams, "X.509 Internet Public Key Infrastructure Online Certificate Status Protocol - OCSP", RFC 2560, June 1999.
  • [OPENPGP] Callas, J., Donnerhacke, L., Finney, H., Shaw, D., and R. Thayer, "OpenPGP Message Format", RFC 4880, November 2007.
  • [PKIX-OLD] Housley, R., Ford, W., Polk, T., and D. Solo, "Internet X.509 Public Key Infrastructure Certificate and CRL Profile", RFC 2459, January 1999.
  • [POP3] Myers, J. and M. Rose, "Post Office Protocol - Version 3", STD 53, RFC 1939, May 1996.
  • [PRIVATE] Rekhter, Y., Moskowitz, R., Karrenberg, D., Groot, G., and E. Lear, "Address Allocation for Private Internets", BCP 5, RFC 1918, February 1996.
  • [S-NAPTR] Daigle, L. and A. Newton, "Domain-Based Application Service Location Using SRV RRs and the Dynamic Delegation Discovery Service (DDDS)", RFC 3958, January 2005.
  • [SECTERMS] Shirey, R., "Internet Security Glossary, Version 2", RFC 4949, August 2007.
  • [SIP] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, A., Peterson, J., Sparks, R., Handley, M., and E. Schooler, "SIP: Session Initiation Protocol", RFC 3261, June 2002.
  • [SIP-CERTS] Gurbani, V., Lawrence, S., and A. Jeffrey, "Domain Certificates in the Session Initiation Protocol (SIP)", RFC 5922, June 2010.
  • [SIP-SIPS] Audet, F., "The Use of the SIPS URI Scheme in the Session Initiation Protocol (SIP)", RFC 5630, October 2009.
  • [SMTP] Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, October 2008.
  • [SMTP-AUTH] Siemborski, R., Ed. and A. Melnikov, Ed., "SMTP Service Extension for Authentication", RFC 4954, July 2007.
  • [SMTP-TLS] Hoffman, P., "SMTP Service Extension for Secure SMTP over Transport Layer Security", RFC 3207, February 2002.
  • [SNMP] Harrington, D., Presuhn, R., and B. Wijnen, "An Architecture for Describing Simple Network Management Protocol (SNMP) Management Frameworks", STD 62, RFC 3411, December 2002.
  • [SNMP-TLS] Hardaker, W., "Transport Layer Security (TLS) Transport Model for the Simple Network Management Protocol (SNMP)", RFC 5953, August 2010.
  • [SYSLOG] Gerhards, R., "The Syslog Protocol", RFC 5424, March 2009.
  • [SYSLOG-DTLS] Salowey, J., Petch, T., Gerhards, R., and H. Feng, "Datagram Transport Layer Security (DTLS) Transport Mapping for Syslog", RFC 6012, October 2010.
  • [SYSLOG-TLS] Miao, F., Ed., Ma, Y., Ed., and J. Salowey, Ed., "Transport Layer Security (TLS) Transport Mapping for Syslog", RFC 5425, March 2009.
  • [TLS] Dierks, T. and E. Rescorla, "The Transport Layer Security (TLS) Protocol Version 1.2", RFC 5246, August 2008.
  • [TLS-EXT] Eastlake 3rd, D., "Transport Layer Security (TLS) Extensions: Extension Definitions", RFC 6066, January 2011.
  • [US-ASCII] American National Standards Institute, "Coded Character Set - 7-bit American Standard Code for Information Interchange", ANSI X3.4, 1986.
  • [USINGTLS] Newman, C., "Using TLS with IMAP, POP3 and ACAP", RFC 2595, June 1999.
  • [WSC-UI] Saldhana, A. and T. Roessler, "Web Security Context: User Interface Guidelines", World Wide Web Consortium LastCall WD-wsc-ui-20100309, March 2010, <http://www.w3.org/TR/2010/WD-wsc-ui-20100309>.
  • [X.500] International Telecommunications Union, "Information Technology - Open Systems Interconnection - The Directory: Overview of concepts, models and services", ITU-T Recommendation X.500, ISO Standard 9594-1, August 2005.
  • [X.501] International Telecommunications Union, "Information Technology - Open Systems Interconnection - The Directory: Models", ITU-T Recommendation X.501, ISO Standard 9594-2, August 2005.
  • [X.509] International Telecommunications Union, "Information Technology - Open Systems Interconnection - The Directory: Public-key and attribute certificate frameworks", ITU-T Recommendation X.509, ISO Standard 9594-8, August 2005.
  • [X.520] International Telecommunications Union, "Information Technology - Open Systems Interconnection - The Directory: Selected attribute types", ITU-T Recommendation X.509, ISO Standard 9594-6, August 2005.
  • [X.690] International Telecommunications Union, "Information Technology - ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)", ITU-T Recommendation X.690, ISO Standard 8825-1, August 2008.
  • [XMPP] Saint-Andre, P., "Extensible Messaging and Presence Protocol (XMPP): Core", RFC 6120, March 2011.
  • [XMPP-OLD] Saint-Andre, P., Ed., "Extensible Messaging and Presence Protocol (XMPP): Core", RFC 3920, October 2004.

Appendix A. Sample Text โœจ

okay so at the time of writing, two application technologies are reusing the recommendations in this spec: email [EMAIL-SRV] and XMPP [XMPP] ๐Ÿ’Œ. We're including the text from [XMPP] here to show the thought process protocol designers might follow for other application technologies ๐Ÿง . Because XMPP uses DNS SRV records to resolve the DNS domain names for application services, the XMPP spec recommends using SRV-IDs ๐Ÿฆ‹.

The text about certificate issuance goes like this:


In a PKIX certificate presented by an XMPP server (aka a "server certificate"), the certificate MUST include one or more XMPP addresses (aka domainparts) associated with XMPP services hosted at the server ๐ŸŽ€. The rules and guidelines defined in [this specification] apply to XMPP server certificates, with these XMPP-specific considerations:

  • Support for the DNS-ID identifier type [PKIX] is REQUIRED in XMPP client and server software implementations ๐Ÿ’–. Certification authorities that issue XMPP-specific certificates MUST support the DNS-ID identifier type. XMPP service providers SHOULD include the DNS-ID identifier type in certificate requests ๐Ÿ’….
  • Support for the SRV-ID identifier type [SRVNAME] is REQUIRED for XMPP client and server software implementations ๐Ÿ”ฅ. (For verification purposes, XMPP client implementations only need to support the "_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 โœจ.
  • Support for the XmppAddr identifier type is encouraged in XMPP client and server software implementations for the sake of backward-compatibility ๐Ÿ•ฐ๏ธ, but it is no longer encouraged in certificates issued by certification authorities or requested by XMPP service providers ๐Ÿ™ˆ.
  • DNS domain names in server certificates MAY contain the wildcard character '*' as the complete left-most label within the identifier ๐ŸŒˆ.

The text about certificate verification goes like this:


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 get set up like this:

  • The initiating entity sets its reference identifier to the 'to' address it communicates in the initial stream header ๐Ÿ“ฌ. This is the identity it expects the receiving entity to provide in a PKIX certificate ๐Ÿ”.
  • The receiving entity sets its reference identifier to the 'from' address communicated by the initiating entity in the initial stream header ๐Ÿ“ฎ. This is the identity the initiating entity is trying to assert ๐Ÿ‘‘.

Appendix B. Prior Art

(This section is non-normative.) ๐Ÿ“š

The recommendations in this document are an abstraction from recommendations in specs for a wide range of application protocols ๐ŸŒธ. To compare and trace the history of thinking about application service identity verification within the IETF, this informative section gathers prior art by including the exact text from various RFCs ๐Ÿ•ฐ๏ธ. The only changes are the names of several references, so they stay coherent with the main body of this document, and the removal of irrelevant text, marked by the characters "[...]" โœ‚๏ธ.

B.1. IMAP, POP3, and ACAP (1999)

In 1999, [USINGTLS] specified the following text about application service identity verification in IMAP, POP3, and ACAP ๐Ÿ“ง:


2.4. Server Identity

During the TLS negotiation, the client MUST check its understanding of the server hostname against the server's identity as presented in the server Certificate message, in order to prevent man-in-the-middle attacks ๐Ÿšจ. Matching is performed according to these rules:

  • The client MUST use the server hostname it used to open the connection as the value to compare against the server name as expressed in the server certificate. The client MUST NOT use any form of the server hostname derived from an insecure remote source (e.g., insecure DNS lookup). CNAME canonicalization is not done ๐Ÿ™…โ€โ™€๏ธ.
  • If a subjectAltName extension of type dNSName is present in the certificate, it SHOULD be used as the source of the server's identity ๐Ÿชช.
  • Matching is case-insensitive ๐Ÿ”ค.
  • A "*" wildcard character MAY be used as the left-most name component in the certificate. For example, *.example.com would match a.example.com, foo.example.com, etc., but would not match example.com ๐Ÿƒ.
  • If the certificate contains multiple names (e.g., more than one dNSName field), then a match with any one of the fields is considered acceptable ๐ŸŽฏ.

If the match fails, the client SHOULD either ask for explicit user confirmation, or terminate the connection and indicate the server's identity is suspect ๐Ÿซฃ.


B.2. HTTP (2000)

In 2000, [HTTP-TLS] specified the following text about application service identity verification in HTTP ๐ŸŒ:


3.1. Server Identity

In general, HTTP/TLS requests are generated by dereferencing a URI. As a consequence, the hostname for the server is known to the client. If the hostname is available, the client MUST check it against the server's identity as presented in the server's Certificate message, in order to prevent man-in-the-middle attacks ๐Ÿ›ก๏ธ.

If the client has external information about the expected identity of the server, the hostname check MAY be omitted ๐Ÿ•ต๏ธ. (For instance, a client may be connecting to a machine whose address and hostname are dynamic, but the client knows the certificate that the server will present.) In such cases, it is important to narrow the scope of acceptable certificates as much as possible in order to prevent man-in-the-middle attacks. In special cases, it may be appropriate for the client to simply ignore the server's identity, but it must be understood that this leaves the connection open to active attack ๐Ÿ˜ฌ.

If a subjectAltName extension of type dNSName is present, that MUST be used as the identity. Otherwise, the (most specific) Common Name field in the Subject field of the certificate MUST be used. Although the use of the Common Name is existing practice, it is deprecated, and Certification Authorities are encouraged to use the dNSName instead ๐Ÿ“›.

Matching is performed using the matching rules specified by [PKIX-OLD]. If more than one identity of a given type is present in the certificate (e.g., more than one dNSName name), a match in any one of the set is considered acceptable. Names may contain the wildcard character * which is considered to match any single domain name component or component fragment. E.g., *.a.com matches foo.a.com but not bar.foo.a.com. f*.com matches foo.com but not bar.com ๐Ÿƒ.

In some cases, the URI is specified as an IP address rather than a hostname. In this case, the iPAddress subjectAltName must be present in the certificate and must exactly match the IP in the URI ๐Ÿ”ข.

If the hostname does not match the identity in the certificate, user oriented clients MUST either notify the user (clients MAY give the user the opportunity to continue with the connection in any case) or terminate the connection with a bad certificate error ๐Ÿšฉ. Automated clients MUST log the error to an appropriate audit log (if available) and SHOULD terminate the connection (with a bad certificate error) ๐Ÿค–. Automated clients MAY provide a configuration setting that disables this check, but MUST provide a setting which enables it โš™๏ธ.

Note that in many cases the URI itself comes from an untrusted source. The above-described check provides no protection against attacks where this source is compromised. For example, if the URI was obtained by clicking on an HTML page which was itself obtained without using HTTP/TLS, a man in the middle could have replaced the URI ๐Ÿ•ธ๏ธ. To prevent this form of attack, users should carefully examine the certificate presented by the server to determine if it meets their expectations ๐Ÿ”Ž.


B.3. LDAP (2000/2006) ๐Ÿงš

okay so LDAP got two rounds of this ๐Ÿ˜ญ first up, in 2000, [LDAP-TLS] said this about checking who the server actually is:


3.6. Server Identity Check

The client MUST check its understanding of the server's hostname against the server's identity as presented in the server's Certificate message, in order to prevent man-in-the-middle attacks. ๐Ÿ™…โ€โ™€๏ธ

Matching is performed according to these rules:

  • The client MUST use the server hostname it used to open the LDAP connection as the value to compare against the server name as expressed in the server's certificate. The client MUST NOT use the server's canonical DNS name or any other derived form of name. ๐Ÿ’…
  • If a subjectAltName extension of type dNSName is present in the certificate, it SHOULD be used as the source of the server's identity. โœจ
  • Matching is case-insensitive. ๐ŸŒธ
  • The "*" wildcard character is allowed. If present, it applies only to the left-most name component. ๐Ÿฆ‹

E.g. *.bar.com would match a.bar.com, b.bar.com, etc. but not bar.com. If there's more than one identity of a given type in the certificate (e.g. more than one dNSName name), a match in any one of the set is considered acceptable. Iconic, honestly ๐Ÿ‘‘

If the hostname doesn't match the dNSName-based identity in the certificate per the above check, user-oriented clients SHOULD either notify the user (clients MAY give the user the opportunity to continue with the connection in any case) or terminate the connection and indicate that the server's identity is suspect. Automated clients SHOULD close the connection, returning and/or logging an error indicating that the server's identity is suspect. ๐Ÿšจ

Beyond the server identity checks described in this section, clients SHOULD be prepared to do further checking to ensure that the server is authorized to provide the service it is observed to provide. The client MAY need to make use of local policy information. ๐Ÿซถ


In 2006, [LDAP-AUTH] came through with its own version ๐Ÿ’–


3.1.3. Server Identity Check

In order to prevent man-in-the-middle attacks, the client MUST verify the server's identity (as presented in the server's Certificate message). In this section, the client's understanding of the server's identity (typically the identity used to establish the transport connection) is called the "reference identity". ๐ŸŽ€

The client determines the type (e.g., DNS name or IP address) of the reference identity and performs a comparison between the reference identity and each subjectAltName value of the corresponding type until a match is produced. Once a match is produced, the server's identity has been verified, and the server identity check is complete. Different subjectAltName types are matched in different ways. Sections 3.1.3.1 - 3.1.3.3 explain how to compare values of various subjectAltName types. ๐Ÿง 

The client may map the reference identity to a different type prior to performing a comparison. Mappings may be performed for all available subjectAltName types to which the reference identity can be mapped; however, the reference identity should only be mapped to types for which the mapping is either inherently secure (e.g., extracting the DNS name from a URI to compare with a subjectAltName of type dNSName) or for which the mapping is performed in a secure manner (e.g., using [DNSSEC], or using user- or admin-configured host-to-address/address-to-host lookup tables). Careful with the mapping, bestie ๐Ÿ‘€

The server's identity may also be verified by comparing the reference identity to the Common Name (CN) [LDAP-SCHEMA] value in the last Relative Distinguished Name (RDN) of the subject field of the server's certificate (where "last" refers to the DER-encoded order, not the order of presentation in a string representation of DER-encoded data). This comparison is performed using the rules for comparison of DNS names in Section 3.1.3.1, below, with the exception that no wildcard matching is allowed. Although the use of the Common Name value is existing practice, it is deprecated, and Certification Authorities are encouraged to provide subjectAltName values instead. Note that the TLS implementation may represent DNs in certificates according to X.500 or other conventions. For example, some X.500 implementations order the RDNs in a DN using a left-to-right (most significant to least significant) convention instead of LDAP's right-to-left convention. The naming drama is real ๐Ÿ™ˆ

If the server identity check fails, user-oriented clients SHOULD either notify the user (clients may give the user the opportunity to continue with the LDAP session in this case) or close the transport connection and indicate that the server's identity is suspect. Automated clients SHOULD close the transport connection and then return or log an error indicating that the server's identity is suspect or both. ๐Ÿ˜ค

Beyond the server identity check described in this section, clients should be prepared to do further checking to ensure that the server is authorized to provide the service it is requested to provide. The client may need to make use of local policy information in making this determination. ๐Ÿ”

3.1.3.1. Comparison of DNS Names

If the reference identity is an internationalized domain name, conforming implementations MUST convert it to the ASCII Compatible Encoding (ACE) format as specified in Section 4 of RFC 3490 [IDNA2003] before comparison with subjectAltName values of type dNSName. Specifically, conforming implementations MUST perform the conversion operation specified in Section 4 of RFC 3490 as follows:

  • in step 1, the domain name SHALL be considered a "stored string";
  • in step 3, set the flag called "UseSTD3ASCIIRules";
  • in step 4, process each label with the "ToASCII" operation; and
  • in step 5, change all label separators to U+002E (full stop).

After performing the "to-ASCII" conversion, the DNS labels and names MUST be compared for equality according to the rules specified in Section 3 of RFC3490. ๐ŸŒˆ

The * (ASCII 42) wildcard character is allowed in subjectAltName values of type dNSName, and then only as the left-most (least significant) DNS label in that value. This wildcard matches any left-most DNS label in the server name. That is, the subject *.example.com matches the server names a.example.com and b.example.com, but does not match example.com or a.b.example.com. ๐Ÿ’œ

3.1.3.2. Comparison of IP Addresses

When the reference identity is an IP address, the identity MUST be converted to the "network byte order" octet string representation [IP] [IPv6]. For IP Version 4, as specified in RFC 791, the octet string will contain exactly four octets. For IP Version 6, as specified in RFC 2460, the octet string will contain exactly sixteen octets. This octet string is then compared against subjectAltName values of type iPAddress. A match occurs if the reference identity octet string and value octet strings are identical. ๐Ÿ”ข

3.1.3.3. Comparison of Other subjectName Types

Client implementations MAY support matching against subjectAltName values of other types as described in other documents. ๐Ÿฆ‹


B.4. SMTP (2002/2007) ๐Ÿ“ฌ

SMTP had its own glow-up arc too ๐Ÿ’… in 2002, [SMTP-TLS] said:


4.1 Processing After the STARTTLS Command

[...]

The decision of whether or not to believe the authenticity of the other party in a TLS negotiation is a local matter. However, some general rules for the decisions are:

  • A SMTP client would probably only want to authenticate an SMTP server whose server certificate has a domain name that is the domain name that the client thought it was connecting to.

[...]


In 2006, [SMTP-AUTH] got more specific ๐Ÿ”ฅ


14. Additional Requirements When Using SASL PLAIN over TLS

[...]

After a successful [TLS] negotiation, the client MUST check its understanding of the server hostname against the server's identity as presented in the server Certificate message, in order to prevent man-in-the-middle attacks. If the match fails, the client MUST NOT attempt to authenticate using the SASL PLAIN mechanism. Matching is performed according to the following rules:

The client MUST use the server hostname it used to open the connection as the value to compare against the server name as expressed in the server certificate. The client MUST NOT use any form of the server hostname derived from an insecure remote source (e.g., insecure DNS lookup). CNAME canonicalization is not done.

If a subjectAltName extension of type dNSName is present in the certificate, it SHOULD be used as the source of the server's identity.

Matching is case-insensitive.

A "*" wildcard character MAY be used as the leftmost name component in the certificate. For example, *.example.com would match a.example.com, foo.example.com, etc., but would not match example.com.

If the certificate contains multiple names (e.g., more than one dNSName field), then a match with any one of the fields is considered acceptable.


B.5. XMPP (2004) ๐Ÿซง

last but not least, XMPP ๐ŸŽ‰ in 2004, [XMPP-OLD] said:


14.2. Certificate Validation

When an XMPP peer communicates with another peer securely, it MUST validate the peer's certificate. There are three possible cases:

Case #1: The peer contains an End Entity certificate which appears to be certified by a certification path terminating in a trust anchor (as described in Section 6.1 of [PKIX]).

Case #2: The peer certificate is certified by a Certificate Authority not known to the validating peer.

Case #3: The peer certificate is self-signed.

In Case #1, the validating peer MUST do one of two things:

  1. Verify the peer certificate according to the rules of [PKIX]. The certificate SHOULD then be checked against the expected identity of the peer following the rules described in [HTTP-TLS], except that a subjectAltName extension of type "xmpp" MUST be used as the identity if present. If one of these checks fails, user-oriented clients MUST either notify the user (clients MAY give the user the opportunity to continue with the connection in any case) or terminate the connection with a bad certificate error. Automated clients SHOULD terminate the connection (with a bad certificate error) and log the error to an appropriate audit log. Automated clients MAY provide a configuration setting that disables this check, but MUST provide a setting that enables it.
  2. The peer SHOULD show the certificate to a user for approval, including the entire certification path. The peer MUST cache the certificate (or some non-forgeable representation such as a hash). In future connections, the peer MUST verify that the same certificate was presented and MUST notify the user if it has changed.

In Case #2 and Case #3, implementations SHOULD act as in (2) above.


Although [XMPP-OLD] defined its own rules, [XMPP] reuses the rules in this document regarding application service identity verification in XMPP. โœจ

B.6. NNTP (2006) ๐Ÿ“ฐ

okay so in 2006, [NNTP-TLS] laid out this text about checking application service identity in NNTP ๐Ÿซถ

5. Security Considerations

[...]

during the TLS negotiation, the client MUST check its understanding of the server hostname against the server's identity as presented in the server Certificate message, so it can prevent man-in-the-middle attacks ๐Ÿ•ต๏ธโ€โ™€๏ธ matching goes by these rules:

  • The client MUST use the server hostname it used to open the connection (or the hostname specified in TLS server_name extension [TLS]) as the value to compare against the server name as expressed in the server certificate. The client MUST NOT use any form of the server hostname derived from an insecure remote source (e.g., insecure DNS lookup). CNAME canonicalization is not done. ๐Ÿ™…โ€โ™€๏ธ
  • If a subjectAltName extension of type dNSName is present in the certificate, it SHOULD be used as the source of the server's identity.
  • Matching is case-insensitive. ๐Ÿ”ค
  • A * wildcard character MAY be used as the left-most name component in the certificate. For example, *.example.com would match a.example.com, foo.example.com, etc., but would not match example.com. ๐ŸŒŸ
  • If the certificate contains multiple names (e.g., more than one dNSName field), then a match with any one of the fields is considered acceptable. ๐Ÿ’…

If the match fails, the client SHOULD either ask for explicit user confirmation or terminate the connection with a QUIT command and indicate the server's identity is suspect. ๐Ÿšฉ

Additionally, clients MUST verify the binding between the identity of the servers to which they connect and the public keys presented by those servers. Clients SHOULD implement the algorithm in Section 6 of [PKIX] for general certificate validation, but MAY supplement that algorithm with other validation methods that achieve equivalent levels of verification (such as comparing the server certificate against a local store of already-verified certificates and identity bindings). ๐Ÿ”


B.7. NETCONF (2006/2009) ๐Ÿงฉ

in 2006, [NETCONF-SSH] said this about application service identity verification in NETCONF:

6. Security Considerations

The identity of the server MUST be verified and authenticated by the client according to local policy before password-based authentication data or any configuration or state data is sent to or received from the server. The identity of the client MUST also be verified and authenticated by the server according to local policy to ensure that the incoming client request is legitimate before any configuration or state data is sent to or received from the client. Neither side should establish a NETCONF over SSH connection with an unknown, unexpected, or incorrect identity on the opposite side. ๐Ÿ™…โ€โ™€๏ธ๐Ÿ”‘


in 2009, [NETCONF-TLS] said this about the same thing, now over TLS ๐ŸŽ€

3.1. Server Identity

During the TLS negotiation, the client MUST carefully examine the certificate presented by the server to determine if it meets the client's expectations. Particularly, the client MUST check its understanding of the server hostname against the server's identity as presented in the server Certificate message, in order to prevent man-in-the-middle attacks.

Matching is performed according to the rules below (following the example of [NNTP-TLS]):

  • The client MUST use the server hostname it used to open the connection (or the hostname specified in the TLS server_name extension [TLS]) as the value to compare against the server name as expressed in the server certificate. The client MUST NOT use any form of the server hostname derived from an insecure remote source (e.g., insecure DNS lookup). CNAME canonicalization is not done.
  • If a subjectAltName extension of type dNSName is present in the certificate, it MUST be used as the source of the server's identity.
  • Matching is case-insensitive.
  • A * wildcard character MAY be used as the leftmost name component in the certificate. For example, *.example.com would match a.example.com, foo.example.com, etc., but would not match example.com. ๐ŸŒˆ
  • If the certificate contains multiple names (e.g., more than one dNSName field), then a match with any one of the fields is considered acceptable.

If the match fails, the client MUST either ask for explicit user confirmation or terminate the connection and indicate the server's identity is suspect. ๐Ÿšจ

Additionally, clients MUST verify the binding between the identity of the servers to which they connect and the public keys presented by those servers. Clients SHOULD implement the algorithm in Section 6 of [PKIX] for general certificate validation, but MAY supplement that algorithm with other validation methods that achieve equivalent levels of verification (such as comparing the server certificate against a local store of already-verified certificates and identity bindings).

If the client has external information as to the expected identity of the server, the hostname check MAY be omitted. ๐Ÿงš


B.8. Syslog (2009) ๐Ÿชต

in 2009, [SYSLOG-TLS] laid out this text about application service identity verification in Syslog ๐Ÿ“

5.2. Subject Name Authorization

Implementations MUST support certification path validation [PKIX]. In addition, they MUST support specifying the authorized peers using locally configured host names and matching the name against the certificate as follows.

  • Implementations MUST support matching the locally configured host name against a dNSName in the subjectAltName extension field and SHOULD support checking the name against the common name portion of the subject distinguished name.
  • The '*' (ASCII 42) wildcard character is allowed in the dNSName of the subjectAltName extension (and in common name, if used to store the host name), but only as the left-most (least significant) DNS label in that value. This wildcard matches any left-most DNS label in the server name. That is, the subject *.example.com matches the server names a.example.com and b.example.com, but does not match example.com or a.b.example.com. Implementations MUST support wildcards in certificates as specified above, but MAY provide a configuration option to disable them. ๐Ÿƒ
  • Locally configured names MAY contain the wildcard character to match a range of values. The types of wildcards supported MAY be more flexible than those allowed in subject names, making it possible to support various policies for different environments. For example, a policy could allow for a trust-root-based authorization where all credentials issued by a particular CA trust root are authorized. ๐Ÿฐ
  • If the locally configured name is an internationalized domain name, conforming implementations MUST convert it to the ASCII Compatible Encoding (ACE) format for performing comparisons, as specified in Section 7 of [PKIX]. ๐ŸŒ
  • Implementations MAY support matching a locally configured IP address against an iPAddress stored in the subjectAltName extension. In this case, the locally configured IP address is converted to an octet string as specified in [PKIX], Section 4.2.1.6. A match occurs if this octet string is equal to the value of iPAddress in the subjectAltName extension. ๐ŸŽฏ

B.9. SIP (2010) โ˜Ž๏ธ

in 2010, [SIP-CERTS] said this about application service identity verification in SIP ๐Ÿ’ฌ

7.2. Comparing SIP Identities

When an implementation (either client or server) compares two values as SIP domain identities:

  • Implementations MUST compare only the DNS name component of each SIP domain identifier; an implementation MUST NOT use any scheme or parameters in the comparison.
  • Implementations MUST compare the values as DNS names, which means that the comparison is case insensitive as specified by [DNS-CASE]. Implementations MUST handle Internationalized Domain Names (IDNs) in accordance with Section 7.2 of [PKIX].
  • Implementations MUST match the values in their entirety:
    • Implementations MUST NOT match suffixes. For example, "foo.example.com" does not match "example.com".
    • Implementations MUST NOT match any form of wildcard, such as a leading "." or "*." with any other DNS label or sequence of labels. For example, "*.example.com" matches only "*.example.com" but not "foo.example.com". Similarly, ".example.com" matches only ".example.com", and does not match "foo.example.com." ๐Ÿ™…โ€โ™€๏ธ

[HTTP-TLS] allows the dNSName component to contain a wildcard; e.g., "DNS:*.example.com". [PKIX], while not disallowing this explicitly, leaves the interpretation of wildcards to the individual specification. [SIP] does not provide any guidelines on the presence of wildcards in certificates. Through the rule above, this document prohibits such wildcards in certificates for SIP domains. ๐Ÿ‘€


B.10. SNMP (2010) ๐Ÿ“ก

in 2010, [SNMP-TLS] said this about application service identity verification in SNMP ๐ŸŒธ

If the server's presented certificate has passed certification path validation [PKIX] to a configured trust anchor, and an active row exists with a zero-length snmpTlstmAddrServerFingerprint value, then the snmpTlstmAddrServerIdentity column contains the expected host name. This expected host name is then compared against the server's certificate as follows:

  • Implementations MUST support matching the expected host name against a dNSName in the subjectAltName extension field and MAY support checking the name against the CommonName portion of the subject distinguished name.
  • The '*' (ASCII 0x2a) wildcard character is allowed in the dNSName of the subjectAltName extension (and in common name, if used to store the host name), but only as the left-most (least significant) DNS label in that value. This wildcard matches any left-most DNS label in the server name. That is, the subject *.example.com matches the server names a.example.com and b.example.com, but does not match example.com or a.b.example.com. Implementations MUST support wildcards in certificates as specified above, but MAY provide a configuration option to disable them.
  • If the locally configured name is an internationalized domain name, conforming implementations MUST convert it to the ASCII Compatible Encoding (ACE) format for performing comparisons, as specified in Section 7 of [PKIX].

If the expected host name fails these conditions then the connection MUST be closed. ๐Ÿ”’

B.11. GIST (2010) โœจ

okay so in 2010, [GIST] (the General Internet Signalling Transport) wrote up its own take on application service identity verification, and it's giving very thorough energy ๐Ÿ’… here's what they said:

######

5.7.3.1. Identity Checking in TLS ๐Ÿ”

After TLS authentication, a node MUST check the identity the peer shows up with ๐Ÿ™ˆ so nobody sneaks in with a man-in-the-middle attack ๐Ÿ˜ญ. It also needs to verify that the peer is authorised to take part in signalling at the GIST layer ๐Ÿ”ฅ. The authorisation check works by comparing the presented identity with each Authorised Peer Database (APD) entry in turn, as discussed in Section 4.4.2. This section defines the identity comparison algorithm for a single APD entry โœจ.

For TLS authentication with X.509 certificates, an identity from the DNS namespace MUST be checked against each subjectAltName extension of type dNSName present in the certificate. If no such extension is present, then the identity MUST be compared to the (most specific) Common Name in the Subject field of the certificate ๐Ÿ“. When matching DNS names against dNSName or Common Name fields, matching is case-insensitive, so capitals don't matter ๐Ÿ’–. Also, a "*" wildcard character MAY be used as the left-most name component in the certificate or identity in the APD ๐Ÿฆ‹. For example, *.example.com in the APD would match certificates for a.example.com, foo.example.com, *.example.com, etc., but would not match example.com ๐Ÿ™ˆ. Similarly, a certificate for *.example.com would be valid for APD identities of a.example.com, foo.example.com, *.example.com, etc., but not example.com ๐Ÿ’….

Additionally, a node MUST verify the binding between the identity of the peer it connects to and the public key presented by that peer ๐Ÿ”‘. Nodes SHOULD implement the algorithm in Section 6 of [PKIX] for general certificate validation, but MAY supplement that algorithm with other validation methods that achieve equivalent levels of verification ๐ŸŒˆ. One example of that is comparing the server certificate against a local store of already-verified certificates and identity bindings ๐Ÿงš.

For TLS authentication with pre-shared keys, the identity in the psk_identity_hint (for the server identity, i.e. the Responding node) or psk_identity (for the client identity, i.e. the Querying node) MUST be compared to the identities in the APD ๐ŸŽ€.

######


Authors' Addresses ๐Ÿซถ

Peter Saint-Andre
Cisco
1899 Wyknoop Street, Suite 600
Denver, CO  80202
USA

Phone: +1-303-308-3282
EMail: psaintan@cisco.com


Jeff Hodges
PayPal
2211 North First Street
San Jose, California  95131
US

EMail: Jeff.Hodges@PayPal.com
๐Ÿ“ฆ where this page comes from