<?xml version="1.0" encoding="UTF-8"?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude"
     ipr="trust200902"
     docName="draft-filimonov-oitls-00"
     category="exp"
     submissionType="independent">
  <front>
    <title abbrev="OI-TLS">Outer-Inner TLS (OI-TLS)</title>
    <author initials="Y." surname="Filimonov" fullname="Filimonov Yaroslav Aleksandrovich">
      <organization>Independent</organization>
      <address>
        <email>evrk.msn@gmail.com</email>
      </address>
    </author>
    <date year="2025" month="November" day="18"/>
    <area>Security</area>
    <workgroup>Individual Submission</workgroup>
    <keyword>Privacy</keyword>
    <keyword>TLS</keyword>
    <keyword>SNI</keyword>
    <abstract>
      <t>
        Outer-Inner TLS (OI-TLS) hides TLS ClientHello metadata (SNI, ALPN, cipher list, JA3)
        from on-path DPI by splitting a TLS session into two layers. The client first establishes
        an outer TLS 1.3 tunnel to an entry node with no SNI, then tunnels an ordinary TLS
        handshake for the backend inside that encrypted channel. This document describes the
        architecture, signaling, deployment considerations, and security trade-offs, together
        with laboratory evidence demonstrating the technique.
      </t>
    </abstract>
  </front>

  <middle>
    <section anchor="introduction">
      <name>Introduction</name>
      <t>
        DPI appliances routinely block HTTPS connections based on TLS ClientHello contents
        such as SNI, ALPN, cipher lists, or JA3 fingerprints (<xref target="RFC8446"/>). OI-TLS inserts an entry node
        between the client and backend. On-path observers see only a normal TLS 1.3 connection
        to an IP address, whereas the true ClientHello is tunneled inside the outer channel.
      </t>
    </section>

    <section anchor="motivation">
      <name>Motivation and Relationship to Existing Work</name>
      <t>
        Encrypted Client Hello (ECH) <xref target="I-D.ietf-tls-esni"/> protects SNI within a single TLS
        handshake but requires clients, DNS, and origin servers to support ECH and to deploy
        DNSHPKE keys. OI-TLS targets operators that can deploy a terminating entry proxy in front
        of unmodified backends; only the entry node needs changes. OI-TLS also hides the entire
        ClientHello (cipher list, JA3, ALPN), not only SNI. Unlike domain-fronting techniques,
        OI-TLS does not rely on CDN misconfiguration; entry nodes are explicit infrastructure.
      </t>
    </section>

    <section anchor="terminology">
      <name>Terminology</name>
      <t><list style="symbols">
        <t>OuterTLS – TLS 1.3 session between client and entry node, no SNI, certificate bound to entry IP.</t>
        <t>InnerTLS – TLS 1.3 (or 1.2) session between client and backend, carried as application data inside OuterTLS.</t>
        <t>Entry Node – Frontend proxy that terminates OuterTLS, parses the inner ClientHello, selects a backend, and relays InnerTLS records.</t>
        <t>Backend – Origin server that terminates the InnerTLS connection.</t>
      </list></t>
    </section>

    <section anchor="architecture">
      <name>Architecture</name>
      <t>
        Client --OuterTLS--> Entry Node --InnerTLS--> Backend.
      </t>
      <t>
        1) DNS discovery: client queries `_oitls.example.com TXT "v=1 ttl_outer=10"` or an HTTPS
        RR `example.com HTTPS ... oi-tls=1` to learn that OI-TLS is supported.
        2) OuterTLS: client connects to the entry IP (A/AAAA answer) with TLS 1.3, no SNI, ordinary extensions.
        3) InnerTLS: client generates a standard ClientHello with the real SNI and transmits it as encrypted application data.
        4) Session lifetime: outer tunnel normally stays up for the session, but entry nodes MUST enforce an advertised TTL
        and drop tunnels where the inner handshake never starts. After the inner handshake completes, entry nodes MAY close the outer tunnel.
      </t>
    </section>

    <section anchor="dns">
      <name>DNS Signaling</name>
      <t>
        Clients SHOULD retrieve `_oitls` TXT/HTTPS records using DoH/DoT (<xref target="RFC8484"/>, <xref target="RFC7858"/>) to hide the signal from DPI; UDP queries still work
        but leak metadata. The TXT record may carry parameters such as outer TTL or ALPN hints. The entry IP is taken from the
        original A/AAAA answer. If no OI-TLS record exists, the client falls back to plain TLS.
      </t>
    </section>

    <section anchor="deployment">
      <name>Deployment Considerations</name>
      <t><list style="symbols">
        <t>Entry Integration: OI-TLS can run within HAProxy/nginx modules or standalone proxies. The entry node inspects only the first inner record.</t>
        <t>Backend Requirements: none—backends see an ordinary TLS session and can host HTTP/1.1, HTTP/2, WebSocket, etc.</t>
        <t>Certificate Validation: OuterTLS MUST use trusted certificates (e.g., ACME for entry IPs). DNS discovery SHOULD use trusted DoH/DoT.</t>
        <t>OuterTLS TTL: entry nodes MUST enforce an advertised TTL (e.g., 5–10s) and drop tunnels with no inner ClientHello. After the inner handshake, outer tunnels MAY be closed.</t>
        <t>Rate Limiting: operators SHOULD cap concurrent OuterTLS sessions and inner handshakes to mitigate CPU-based DDoS.</t>
      </list></t>
    </section>

    <section anchor="implementation">
      <name>Implementation Status</name>
      <t>
        Reference code and Docker labs are available at https://github.com/EvrkMs/OI-TLS.
        The labs include a baseline HTTPS flow where DPI observes SNI and an OI-TLS flow where DPI’s SNI extractor fails.
        These labs demonstrate the logic and are not production SDKs; real deployments require separate client/entry implementations.
      </t>
    </section>

    <section anchor="security">
      <name>Security Considerations</name>
      <t>
        OI-TLS hides ClientHello metadata but does not defend against IP blocking, volumetric DDoS, or backend compromise.
        Entry nodes become trusted points of failure; if compromised they reveal all SNI values. Proper certificate validation and
        DoH/DoT are required to avoid MITM. Entry nodes must be protected via Anycast, load balancing, and rate limiting.
      </t>
    </section>

    <section anchor="iana">
      <name>IANA Considerations</name>
      <t>This document makes no requests of IANA.</t>
    </section>
  </middle>

  <back>
    <references>
      <name>References</name>
      <reference anchor="RFC8446" target="https://www.rfc-editor.org/info/rfc8446">
        <front>
          <title>The Transport Layer Security (TLS) Protocol Version 1.3</title>
          <author initials="E." surname="Rescorla" fullname="Eric Rescorla"/>
          <date year="2018" month="August"/>
        </front>
        <seriesInfo name="RFC" value="8446"/>
      </reference>
      <reference anchor="RFC8484" target="https://www.rfc-editor.org/info/rfc8484">
        <front>
          <title>DNS Queries over HTTPS (DoH)</title>
          <author initials="P." surname="Hoffman"/>
          <author initials="P." surname="McManus"/>
          <date year="2018" month="October"/>
        </front>
        <seriesInfo name="RFC" value="8484"/>
      </reference>
      <reference anchor="RFC7858" target="https://www.rfc-editor.org/info/rfc7858">
        <front>
          <title>Specification for DNS over Transport Layer Security (TLS)</title>
          <author initials="Z." surname="Hu"/>
          <date year="2016" month="May"/>
        </front>
        <seriesInfo name="RFC" value="7858"/>
      </reference>
      <reference anchor="I-D.ietf-tls-esni" target="https://datatracker.ietf.org/doc/draft-ietf-tls-esni/">
        <front>
          <title>TLS Encrypted Client Hello</title>
          <author initials="E." surname="Rescorla"/>
          <date year="2024"/>
        </front>
      </reference>
    </references>
  </back>
</rfc>
