Skip to content

Support proxying TLS without terminating it #151

Closed

Description

@KellerFuchs

Would it be possible to add the possibility to forward a whole TLS stream, based on SNI, without terminating it? (Ideally, using splicing as in #63)

This is very helpful in cases where the certificate and signing key are not provisioned on the proxy.

I would be willing to contribute the code, assuming I can, as I could use this feature for hashbang.sh.

Activity

  1. Geal commented on Apr 16, 2017

    @Geal
    Member

    this will probably be too hard to do with the current openssl based implementation, so we will need to wait on #145 to get a more flexible TLS implementation based on rustls.
    For the context, in openssl, you give a callback to find which certificate to send based on the SNI extension. From that callback, it would not be possible to do a passthrough to the backend, since openssl already manages the stream.

  2. KellerFuchs commented on Apr 17, 2017

    @KellerFuchs
    Author

    @ctx Is matching SNI without terminating the whole TLS stream doable with rustls?
    That would be pretty neat :)

  3. Geal commented on Apr 30, 2017

    @Geal
    Member

    it might be doable by reusing this nom TLS parser: https://github.com/rusticata/tls-parser
    Then the proxy would only read the beginning of the communication, route based on the named then just splice calls back and forth

  4. self-assigned this
    on Jul 27, 2017
  5. added this to the milestone on Jul 27, 2017
  6. modified the milestones: , 0.12 on Jun 5, 2019
  7. Geal commented on Jun 5, 2019

    @Geal
    Member

    I started to work on it in the peek-sni branch, but it will have to wait until #588 is done

  8. modified the milestones: v0.14.0, next on Feb 18, 2022
  9. added
    tls
    and removed on May 4, 2026
  10. FlorentinDUBOIS commented on Sep 29, 2026

    @FlorentinDUBOIS
    Collaborator

    Proxying TLS without terminating it is supported: a protocol = "tcp" listener can route several clusters on one address by pre-reading the ClientHello's SNI (and optionally ALPN), without decrypting — #1290, documented in the TCP SNI section of doc/configure.md (sni_preread_timeout, sni_preread_max_bytes, frontend hostname / alpn), implemented by the SniPreread state in lib/src/tcp.rs, covered by e2e/src/tests/tcp_sni_tests.rs. Single-cluster TCP passthrough predates it. Closing as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementtls

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions