<?xml version="1.0" encoding="US-ASCII"?>
<?rfc toc="yes"?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="std" submissionType="IETF" consensus="true" ipr="trust200902" docName="draft-ietf-regext-epp-https-00">
  <front>
    <title abbrev="EPP over HTTPS">
      Extensible Provisioning Protocol (EPP) Transport over HTTPS
    </title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-regext-epp-https-00"/>
    <author fullname="Mario Loffredo" initials="M" surname="Loffredo">
      <organization>IIT-CNR/Registro.it</organization>
      <address>
        <postal>
          <street>Via Moruzzi,1</street>
          <city>Pisa</city>
          <country>IT</country>
          <code>56124</code>
        </postal>
        <email>mario.loffredo@iit.cnr.it</email>
        <uri>https://www.iit.cnr.it</uri>
      </address>
    </author>
    <author fullname="Lorenzo Luconi Trombacchi" initials="L" surname="Luconi Trombacchi">
      <organization>IIT-CNR/Registro.it</organization>
      <address>
        <postal>
          <street>Via Moruzzi,1</street>
          <city>Pisa</city>
          <country>IT</country>
          <code>56124</code>
        </postal>
        <email>lorenzo.luconi@iit.cnr.it</email>
        <uri>https://www.iit.cnr.it</uri>
      </address>
    </author>
    <author fullname="Maurizio Martinelli" initials="M." surname="Martinelli">
      <organization>IIT-CNR/Registro.it</organization>
      <address>
        <postal>
          <street>Via Moruzzi,1</street>
          <city>Pisa</city>
          <country>IT</country>
          <code>56124</code>
        </postal>
        <email>maurizio.martinelli@iit.cnr.it</email>
        <uri>https://www.iit.cnr.it</uri>
      </address>
    </author>
    <author fullname="Daniel Keathley" initials="D" surname="Keathley">
      <organization>VeriSign, Inc.</organization>
      <address>
        <postal>
          <street>12061 Bluemont Way</street>
          <city>Reston</city>
          <region>VA</region>
          <code>20190</code>
          <country>US</country>
        </postal>
        <email>dkeathley@verisign.com</email>
        <uri>http://www.verisigninc.com</uri>
      </address>
    </author>
    <author fullname="James Gould" initials="J" surname="Gould">
      <organization>VeriSign, Inc.</organization>
      <address>
        <postal>
          <street>12061 Bluemont Way</street>
          <city>Reston</city>
          <region>VA</region>
          <code>20190</code>
          <country>US</country>
        </postal>
        <email>jgould@verisign.com</email>
        <uri>http://www.verisigninc.com</uri>
      </address>
    </author>
    <area>ART</area>
    <workgroup>Internet Engineering Task Force</workgroup>
    <keyword>epp https</keyword>
    <abstract>
      <t>This document describes how an Extensible Provisioning Protocol (EPP)
      connection is mapped onto a Hypertext Transfer Protocol (HTTP) session. EPP
      over HTTP (EoH) requires the use of Transport Layer Security (TLS) to secure
      EPP information (i.e. HTTPS).</t>
    </abstract>
  </front>
  <middle>
    <section title="Introduction">
      <t>This document describes how EPP <xref target="RFC5730"/> is mapped onto
      HTTP <xref target="RFC9110"/>. Note that there are several versions of HTTP
      currently in use, including: HTTP/1.1 <xref target="RFC9112"/>, HTTP/2
      <xref target="RFC9113"/>, and HTTP/3 <xref target="RFC9114"/>. As the
      differences among such versions do not affect the EPP mapping described in
      this document, hereinafter the version number is omitted except for presenting
      the special features in the underlying layers of the HTTP stack.</t>
      <t>HTTP represents a higher-level abstraction of a network connection,
      removing the need to directly deal with all of the lower-level details of
      transport protocols. This makes HTTP much more compatible with cloud-native
      infrastructures, and facilitates faster development times and reduced
      maintenance costs in such environments.</t>
      <t>Security services beyond those defined in EPP are provided by TLS via HTTPS
      <xref target="RFC9110" section="4.2.2"/>.</t>
    </section>
    <section anchor="conventions" numbered="true" toc="default">
      <name>Conventions Used in This Document</name>
      <t>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
      <xref target="BCP14"/> when, and only when, they appear in all capitals, as
      shown here.</t>
    </section>
    <section title="Session Management" anchor="session-management">
      <t>Mapping EPP session management facilities onto HTTP is
      accomplished using existing HTTP methods, namely GET and POST. An EPP
      session exists on top of an EPP connection between two peers, one
      that initiates the connection request and one that responds to the connection
      request. The initiating peer is called the "client", and the responding peer
      is called the "server". An EPP server implementing this specification MUST
      listen for HTTP session requests on a standard HTTP port assigned by IANA.</t>
      <t>Even though HTTP itself is stateless, a stateful EPP session can be
      achieved using the mechanism described in <xref target="RFC6265"/>. This
      mechanism uses "Set-Cookie" and "Cookie" HTTP headers to facilitate a stateful
      HTTP session. Such a session is initiated by the client via sending a GET
      request to the sever. The GET request MUST include "application/epp+xml"
      (<xref target="RFC5730" section="B"/>) in the "Accept" HTTP header. The server 
      MUST include the EPP Greeting in the response.  The EPP Greeting must include 
      "application/epp+xml" in the "Content-Type" header with the character encoding 
      of the EPP XML (e.g., "application/epp+xml;charset=UTF-8") 
      and MUST include ""no-cache" in the "Cache-Control" header and 
      include "0" in the "Expires" header to disable caching. The server MUST use the
      "Set-Cookie" header to include a token that represents the identifier of the
      HTTP session. All subsequent HTTP requests that include the HTTP session
      identifier in the "Cookie" header will be treated as part of the session. The
      HTTP session represents an EPP connection, referred to as an EPP over HTTP
      (EoH) connection, which is initiated by the initial GET request.</t>
      <t>The EPP session begins with a successful EPP &lt;login&gt; command on the
      EoH connection and can be referred to as an EPP over HTTP (EoH) session.</t>
      <t>An EPP session is normally ended by the client issuing an EPP
      &lt;logout&gt; command. A server receiving an EPP &lt;logout&gt; command MUST
      end the EPP session. A server MAY also end an EPP session that has been
      either active or inactve for longer than a server-defined period. A server MAY
      end the HTTP session after ending the EPP session.</t>
    </section>
    <section title="Message Exchange" anchor="message-exchange">
      <t>EPP describes client-server interaction as a command-response exchange
      where the client sends one command to the server and the server returns one
      response to the client. With the exception of the EPP Greeting, EPP messages
      are initiated by the EPP client in the form of EPP commands. An EPP client
      MUST send all commands as HTTP POST requests
      (<xref target="RFC9110" section="6.4"/>). Each POST request MUST include the 
      HTTP session identifier in the "Cookie" header and "application/epp+xml" 
      in the "Accept" header. An EPP server MUST return an EPP response to an 
      EPP command in the HTTP response to the respective HTTP request. 
      The EPP command and the EPP response MUST include "application/epp+xml" in 
      the "Content-Type" header with the character encoding of the EPP XML 
      (e.g., "application/epp+xml;charset=UTF-8").  
      The EPP response MUST include "no-cache" in the "Cache-Control" header and 
      include "0" in the "Expires" header to disable caching.</t>
      <t>HTTP does not guarantee that POST requests are idempotent. However, the
      semantics of EPP do require EPP commands to be idempotent, so processing a
      command more than once will produce the same net effect on the repository as
      successfully processing the command once.</t>
      <t>The EPP command XML is framed by the content of the HTTP POST request, and
      the EPP response XML is framed by the content of the HTTP response. Each HTTP
      request MUST contain a single EPP message, and each HTTP response MUST contain
      a single EPP response. Commands MUST be processed independently and in the
      same order as received from the client.</t>
      <t>Servers MUST NOT use HTTP return codes to signal clients about the failure
      of the EPP commands. The HTTP code 200 MUST be used for both
      successful and unsuccessful EPP requests. Servers MUST use HTTP codes to
      signal clients about the failure of the HTTP requests.</t>
      <t>Servers MUST return an EPP 2002 response (i.e. Command use error) if the
      client issues an EPP command with either an empty or an invalid HTTP session
      identifier.</t>
      <t>A server SHOULD impose a limit on the amount of time required for a client
      to issue a well-formed EPP command.  A server SHOULD end an EPP session if a
      well-formed command is not received within the time limit.</t>
      <t>HTTP/2 and HTTP/3 support a multiplexing feature that was introduced to
      address head-of-line blocking issues in previous HTTP versions. In the context
      of multiple requests being sent on a single HTTP connection, multiplexing
      allows the delivery of responses in a different order from how the requests
      were made. Due to this behavior, pipelining MUST NOT be used by EoH clients.
      EoH clients MUST wait for a server response to a command before sending a
      subsequent command.</t>
      <t>A general state machine for an EPP server is described in
      <xref target="RFC5730" section="2"/>. A  general client-server message
      exchange using HTTP is illustrated in Figure 1.

        <figure><artwork><![CDATA[
                       Client                  Server
                  |                                     |
                  |             GET Server URL          |
                  | >>------------------------------->> |
                  |                                     |
                  |             Send Greeting           |
                  | <<-------------------------------<< |
                  |                                     |
                  |             POST <login>            |
                  | >>------------------------------->> |
                  |                                     |
                  |             Send Response           |
                  | <<-------------------------------<< |
                  |                                     |
                  |            POST Command X           |
                  | >>------------------------------->> |
                  |                                     |
                  |            Send Response X          |
                  | <<-------------------------------<< |
                  |                                     |
                  |            POST Command Y           |
                  | >>------------------------------->> |
                  |                                     |
                  |            Send Response Y          |
                  | <<-------------------------------<< |
                  |                  .                  |
                                     .
                                     .
                  |            POST <logout>            |
                  | >>------------------------------->> |
                  |                                     |
                  |            Send Response            |
                  | <<-------------------------------<< |

               Figure 1: HTTP Client-Server Message Exchange
          ]]></artwork></figure>
      </t>
      <t>The EPP server MUST follow the "EPP Server State Machine" procedure
      described in <xref target="RFC5730" sectionFormat="of"/>.</t>
    </section>
    <section title="Transport Considerations">
      <t><xref target="RFC5730" section="2.1"/> describes considerations to be
        addressed by protocol transport mappings. This document addresses each
        of those considerations using a combination of features of the HTTP
        protocol itself and features of this document.

        <ul><li>
            Command Order: <xref target="message-exchange"/> includes a requirement
            for ordered message delivery.
          </li><li>
            Session Mapping: EPP session management is described in
            <xref target="session-management"/> of this document.
          </li><li>
            Stateful Nature: Achieving the stateful nature of EPP is described in
            <xref target="session-management"/>.
          </li><li>
            Frame Data Units: <xref target="message-exchange"/> of this document describes how each
            EPP command is framed within the content of HTTP requests and responses.
          </li><li>
            Congestion Avoidance: <xref target="RFC8095" section="3.9.3"/> confirms
            congestion avoidance as a feature of HTTP.
          </li><li>
            Reliability: <xref target="RFC8095" section="3.9.3"/> confirms reliable
            message delivery as a feature of HTTP.
          </li><li>
            Pipelining: <xref target="message-exchange"/> of this document
            stipulates that command pipelining must not be used in EoH.
          </li></ul>
      </t>
    </section>
    <section title="IANA Considerations" anchor="iana">
      <t>This specification does not request any actions by IANA.</t>
    </section>
    <section anchor="Implementation" numbered="true" toc="default">
      <name>Implementation Status</name>
      <t>Note to RFC Editor: Please remove this section and the reference to
         <xref target="RFC7942" format="default"/> before publication.</t>
      <t>This section records the status of known implementations of the
      protocol defined by this specification at the time of posting of
      this Internet-Draft, and is based on a proposal described in <xref target="RFC7942" format="default"/>.  
      The description of implementations in this section is
      intended to assist the IETF in its decision processes in
      progressing drafts to RFCs.  Please note that the listing of any
      individual implementation here does not imply endorsement by the
      IETF.  Furthermore, no effort has been spent to verify the
      information presented here that was supplied by IETF contributors.
      This is not intended as, and must not be construed to be, a
      catalog of available implementations or their features.  Readers
      are advised to note that other implementations may exist.</t>

      <t>According to <xref target="RFC7942" format="default"/>, "this will allow reviewers and working
      groups to assign due consideration to documents that have the
      benefit of running code, which may serve as evidence of valuable
      experimentation and feedback that have made the implemented
      protocols more mature.  It is up to the individual working groups
      to use this information as they see fit".</t>

      <section numbered="true" toc="default">
        <name>Verisign EPP SDK</name>
        <t>Organization: Verisign Inc.</t>
        <t>Name: Verisign EPP SDK</t>
        <t>Description: The Verisign EPP SDK includes both a full client implementation
        and a full server stub implementation of draft-loffredo-regext-epp-over-http.  Both 
        HTTP/1.1 and HTTP/2 were implemented, but HTTP/3 was not due to the lack of support 
        of the underlying library.</t>
        <t>Level of maturity: Development</t>
        <t>Coverage: All aspects of the protocol are implemented with HTTP/1.1 and HTTP/2.</t>
        <t>Licensing: GNU Lesser General Public License</t>
        <t>Contact: jgould@verisign.com</t>
        <t>URL: https://www.verisign.com/en_US/channel-resources/domain-registry-products/epp-sdks</t>
      </section>

    </section>
    <section title="Security Considerations" anchor="security">
      <t>Since client credentials are included in the EPP &lt;login&gt; command, HTTPS
      (<xref target="RFC9110" section="4.2.2"/>) MUST be used to protect them from
      disclosure while in transit. HTTPS indicates that TLS is being used to secure
      the HTTP connection between the client and server. Transferring over TLS also
      prevents sniffing the HTTP session identifier and, consequently, impersonating
      a client to perform actions on registrars' objects. Servers are REQUIRED to
      support TLS 1.2 <xref target="RFC8446"/><xref target="RFC9155"/> or higher.</t>
      <t>Servers are RECOMMENDED to implement additional measures to verify the
      client. These measures include IP allow-listing and locking the HTTP session
      identifier to the client's IP address.</t>
      <t>HTTP session identifiers SHOULD be randomly generated to mitigate the risk
      of obtaining a valid one through a brute-force search. A HTTP session
      identifier SHOULD be at least 128 bits or 16 bytes long. An example of a
      reliable HTTP session identifier is the Universally Unique Identifier (UUID).
      Servers MAY limit the lifetime of active sessions to avoid them being
      exchanged for a long time.</t>
      <t>The following measures MAY also be taken to control cookies usage:
        <ul><li>
          Restricting their scope through the "Domain" and "Path" attributes
        </li><li>
          Limiting their lifetime through the "Max-Age" and "Expire" attributes
        </li></ul>
      </t>
      <t>Other attributes that are normally used to secure the cookies and prevent
      them to be accessed by unintended parties or scripts, such as "HttpOnly" and
      "Secure", are meaningless in this context. Finally, servers are RECOMMENDED to
      perform additional checks to limit the rate of open EPP sessions and HTTP
      connections to mitigate the risk of congestion of requests. Here again, IP
      allow-listing could also be implemented to prevent DDoS attacks.</t>
      <t>As a further measure to enforce the security, servers MUST require
      clients to present a digital certificate. Clients who possess and present a
      valid X.509 digital certificate, issued by a recognized Certification
      Authority (CA), could be identified and authenticated by a server who trusts
      the corresponding CA. This certificate-based mechanism is supported by HTTPS
      and can be used with EPP over HTTP.</t>
      <t>If the EPP server is configured as a load balancer routing the requests to
      a pool of backend servers, some of the aforementioned checks SHOULD be
      implemented on the load balancer side.</t>
    </section>
    <section title="Acknowledgements" anchor="Acknowledgements">
      <t>The authors wish to acknowledge the input from the .IT technical team.</t>
    </section>
  </middle>
  <back>
    <references title="Normative References">
      <referencegroup anchor="BCP14" target="https://www.rfc-editor.org/info/bcp14">
        <xi:include href="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
      </referencegroup>
      <xi:include href="http://xml.resource.org/public/rfc/bibxml/reference.RFC.5730.xml"/>
      <xi:include href="http://xml.resource.org/public/rfc/bibxml/reference.RFC.6265.xml"/>
      <xi:include href="http://xml.resource.org/public/rfc/bibxml/reference.RFC.7942.xml"/>
      <xi:include href="http://xml.resource.org/public/rfc/bibxml/reference.RFC.8095.xml"/>
      <xi:include href="http://xml.resource.org/public/rfc/bibxml/reference.RFC.8446.xml"/>
      <xi:include href="http://xml.resource.org/public/rfc/bibxml/reference.RFC.9110.xml"/>
      <xi:include href="http://xml.resource.org/public/rfc/bibxml/reference.RFC.9112.xml"/>
      <xi:include href="http://xml.resource.org/public/rfc/bibxml/reference.RFC.9113.xml"/>
      <xi:include href="http://xml.resource.org/public/rfc/bibxml/reference.RFC.9114.xml"/>
      <xi:include href="http://xml.resource.org/public/rfc/bibxml/reference.RFC.9155.xml"/>
    </references>
    <section numbered="true" toc="default">
      <name>Change History</name>
      <section anchor="change-02-to-03" numbered="true" toc="default">
        <name>Change from 02 to 03</name>
        <ol spacing="compact" type="1">
          <li>Added Dan Keathley and James Gould as co-authors.</li>
        </ol>
      </section>
      <section anchor="change-03-to-04" numbered="true" toc="default">
        <name>Change from 03 to 04</name>
        <ol spacing="compact" type="1">
          <li>Clarified the difference between an EoH connection and an EPP session.</li>
          <li>Added inclusion of the "Content-Type" header in every request and response except for the initial GET establishing the EoH connection.</li>
          <li>Revised the Security Considerations section.</li>
        </ol>
      </section>
      <section anchor="change-04-to-05" numbered="true" toc="default">
        <name>Change from 04 to 05</name>
        <ol spacing="compact" type="1">
          <li>Added the Implementation Status section with the Verisign EPP SDK implementation.</li>
          <li>Removed the "Internationalization Considerations" section and added the EoH character encoding matching the EPP XML character encoding 
         for the EPP Greeting, the EPP commands, and the EPP responses.</li>
          <li>Added inclusion of the "Cache-Control" and "Expires" headers for the the EPP Greeting, the EPP commands, and the EPP responses.</li>
        </ol>
      </section>
    </section>
  </back>
</rfc>
