Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add probe for TLSv1.3 ECH (Encrypted ClientHello, ESNI replacement) #1453

Open
eighthave opened this issue Apr 20, 2021 · 19 comments
Open

add probe for TLSv1.3 ECH (Encrypted ClientHello, ESNI replacement) #1453

eighthave opened this issue Apr 20, 2021 · 19 comments
Assignees
Labels

Comments

@eighthave
Copy link

I'm working with @sftcd on implementing the TLSv1.3 ECH standard as widely as possible. One thing that would be quite helpful would be to have data on whether anyone is blocking ECH currently. OONI seems like the best platform for that. I've never implemented an OONI probe. I have some funding to pay either myself or someone more qualified to do this.

I believe there is already an ESNI probe so that would be quite closely related.

@eighthave eighthave added bug Something isn't working triage labels Apr 20, 2021
@bassosimone
Copy link
Contributor

@eighthave that's super interesting! If I understand it correctly, your project/implementation is to add support for that in OpenSSL, am I correct? We are currently mostly using Go code. I know https://github.com/cloudflare/go is a fork of Go that also implements ECH. Could using this be a (maybe not so cheap but certainly quite interesting) way of running these tests with OONI?

@eighthave
Copy link
Author

eighthave commented Apr 20, 2021 via email

@sftcd
Copy link

sftcd commented Apr 20, 2021 via email

@eighthave
Copy link
Author

eighthave commented Apr 20, 2021 via email

@sftcd
Copy link

sftcd commented Apr 20, 2021 via email

@eighthave
Copy link
Author

eighthave commented Apr 21, 2021 via email

@eighthave
Copy link
Author

eighthave commented Sep 14, 2021

This is still interesting to us. Anything we can do to help? We have lots of example code in C and C++ for example.

@d1vyank
Copy link

d1vyank commented Jul 29, 2022

I am interested in taking this up. Given ECH’s ‘do not stick out’ requirements and attempts by censors to block prior iterations of the protocol (ESNI), I think it is important to test early on if the draft version of ECH is subject to any network interference.

I propose to add an experimental test to probe-cli or miniooni that attempts a TLS connection with an encrypted Client Hello. I’ve looked into the two approaches discussed above:

  • Use Cloudflare’s ECH implementation: This approach will require compiling OONI with Cloudflare's Go fork as they have implemented ECH in the standard library, and Go does not permit swapping out parts of the standard library (discussion here). I imagine this will require a new make command that will fetch and compile cloudflare/go and then build OONI with the forked version of Go. We can also use compiler directives to exclude the ECH test when regular versions of Go are used. Once built with the fork, the test can simply use crypto/tls to attempt an ECH connection to a server that supports it.
  • Attempt a GREASE’d ECH connection: Since ECH connections are supposed to look identical to non-ECH connections, the protocol allows for a mocked ECH extension with random values to be present in the Client Hello. The test can use a library like refraction-networking/uTLS to get access to the Client Hello during the TLS handshake and insert a mock ECH extension.

I am leaning towards the GREASE approach as it seems like a less intrusive change than using a Go fork. Even though GREASE is not a complete ECH connection, it will provide valuable early evidence of interference to TLS connections using the ECH extension.

Happy to hear your thoughts!

@sftcd
Copy link

sftcd commented Jul 29, 2022 via email

@kelmenhorst
Copy link
Collaborator

Update: Since we have ECH check in the tree for a few months now, we want to start collecting the first baseline measurements. We will start by adding it to the experimental nettest suite, with single static input.

@eighthave
Copy link
Author

eighthave commented Aug 30, 2023 via email

@kelmenhorst
Copy link
Collaborator

@eighthave Thanks, that would be great, what sites would you recommend then?

@eighthave
Copy link
Author

https://crypto.cloudflare.com/cdn-cgi/trace and tls-ech.dev would probably be a good place to start.

we maintain a list here, you could try any of those https://github.com/sftcd/openssl/blob/ECH-draft-13c/esnistuff/smoke_ech.sh#L10

bassosimone added a commit to ooni/probe-cli that referenced this issue Oct 11, 2023
## Checklist

- [x] I have read the [contribution
guidelines](https://github.com/ooni/probe-cli/blob/master/CONTRIBUTING.md)
- [x] reference issue for this pull request:
ooni/probe#1453
ooni/probe#2547
- [x] if you changed anything related to how experiments work and you
need to reflect these changes in the ooni/spec repository, please link
to the related ooni/spec pull request:
https://github.com/kelmenhorst/spec/tree/echcheck-spec
- [x] if you changed code inside an experiment, make sure you bump its
version number

## Description

This diff does two things:

1. Add `echcheck` to the experimental nettest suite. We do not provide
input which causes the experiment to use the default URL
`https://crypto.cloudflare.com/cdn-cgi/trace` (URL
[proposed](ooni/probe#1453 (comment))
by @eighthave). With this single input configuration we can collect the
first experimental ECH measurements.

2. Add netem tests to `echcheck`, while keeping a "real-internet" test
to connect to an ECH-enabled server.

---------

Co-authored-by: Simone Basso <[email protected]>
bassosimone added a commit to ooni/probe-cli that referenced this issue Oct 11, 2023
This diff backports #1217 to the release/3.19 branch.

- [x] I have read the [contribution
guidelines](https://github.com/ooni/probe-cli/blob/master/CONTRIBUTING.md)
- [x] reference issue for this pull request:
ooni/probe#1453
ooni/probe#2547
- [x] if you changed anything related to how experiments work and you
need to reflect these changes in the ooni/spec repository, please link
to the related ooni/spec pull request:
https://github.com/kelmenhorst/spec/tree/echcheck-spec
- [x] if you changed code inside an experiment, make sure you bump its
version number

This diff does two things:

1. Add `echcheck` to the experimental nettest suite. We do not provide
input which causes the experiment to use the default URL
`https://crypto.cloudflare.com/cdn-cgi/trace` (URL
[proposed](ooni/probe#1453 (comment))
by @eighthave). With this single input configuration we can collect the
first experimental ECH measurements.

2. Add netem tests to `echcheck`, while keeping a "real-internet" test
to connect to an ECH-enabled server.

---------

Co-authored-by: Simone Basso <[email protected]>
@eighthave
Copy link
Author

We just published a HOWTO for how to set up dev/test servers using our TLS Encrypted ClientHello (ECH) enabled forks of OpenSSL, nginx and curl running on Debian. It should be very quick to get started using a new domain: https://guardianproject.info/2023/11/10/quick-set-up-guide-for-encrypted-client-hello-ech/

We just bought some dirt cheap domains and set up test sites. I think OONI devs will find this useful going forward. We might be able to provide a pre-configured VPS for you to mess with too.

Murphy-OrangeMud pushed a commit to Murphy-OrangeMud/probe-cli that referenced this issue Feb 13, 2024
## Checklist

- [x] I have read the [contribution
guidelines](https://github.com/ooni/probe-cli/blob/master/CONTRIBUTING.md)
- [x] reference issue for this pull request:
ooni/probe#1453
ooni/probe#2547
- [x] if you changed anything related to how experiments work and you
need to reflect these changes in the ooni/spec repository, please link
to the related ooni/spec pull request:
https://github.com/kelmenhorst/spec/tree/echcheck-spec
- [x] if you changed code inside an experiment, make sure you bump its
version number

## Description

This diff does two things:

1. Add `echcheck` to the experimental nettest suite. We do not provide
input which causes the experiment to use the default URL
`https://crypto.cloudflare.com/cdn-cgi/trace` (URL
[proposed](ooni/probe#1453 (comment))
by @eighthave). With this single input configuration we can collect the
first experimental ECH measurements.

2. Add netem tests to `echcheck`, while keeping a "real-internet" test
to connect to an ECH-enabled server.

---------

Co-authored-by: Simone Basso <[email protected]>
@eighthave
Copy link
Author

Just checking in on this. I see some things have been merged, but I can't find any references to ECH in https://explorer.ooni.org. Is there a way to see data on ECH yet?

Also, we have developer time and budget to spend on supporting OONI with this. Please let us know how best to jump in here.

@eighthave
Copy link
Author

IIRC, these tests are written in Go. golang's core crypto/tls merged client ECH support, should be in golang 1.23. https://go-review.googlesource.com/c/go/+/578575

@eighthave
Copy link
Author

We want to push this forward. One very useful improvement would be to save the RetryRequest after sending ECH GREASE. A full ECH connection with DNS tracking is the ideal.

FYI @irl has joined us in working on DEfO, and pointed us to the OONI ECH spec and other things in this codebase.

If you're on Matrix, we can help you interactively with any ECH questions or problems: https://matrix.to/#/#ech-dev:matrix.org

Go 1.23 has partial support for ECH on the Client Side: golang/go#63369. It still cannot fetch the ECH keys and there is no server-side support, but they would like to add it to 1.24: golang/go#68500 The client takes bytes for the config list: https://pkg.go.dev/crypto/tls@master#Config.EncryptedClientHelloConfigList

@sftcd
Copy link

sftcd commented Oct 15, 2024

RetryRequest

Just to clarify: that should be "retry_configs" - in the ECH protocol, if a client sends GREASE'd ECH then a server that does support ECH ought reply including an ECH extension in it's EncryptedExtensions reply with the payload of that being a set of ECHConfig values that can be used with that server (i.e. the stuff a browser would have gotten from an HTTPS RR in the DNS). If the OONI probe could record those values that would be useful data. (I'm not sure what golang APIs might allow doing that, but they may exist.) Going further, if the OONI probe could then use those values in a real ECH attempt (i.e. non-GREASE) and record that result, then that'd be a fine 2nd step forward once the golang TLS library has support for the client-side of ECH, and without having to code up all the HTTPS RR DNS handling.

@hellais
Copy link
Member

hellais commented Nov 3, 2024

I wrote a simple golang PoC of doing encrypted clienthello using the implementation part of golang 1.23. You can find it here: https://github.com/hellais/ech.

The code should cleaned up a bit before we integrate it into OONI Probe, but should show the basic pieces of how to perform the DoH lookup, parse the ECH configuration and pass it to go/tls.

DecFox pushed a commit to ooni/probe-cli that referenced this issue Nov 20, 2024
)

## Checklist

- [x] I have read the [contribution
guidelines](https://github.com/ooni/probe-cli/blob/master/CONTRIBUTING.md)
- [x] reference issue for this pull request:
ooni/probe#1453
- [x] if you changed anything related to how experiments work and you
need to reflect these changes in the ooni/spec repository, please link
to the related ooni/spec pull request:
ooni/spec#297
- [x] if you changed code inside an experiment, make sure you bump its
version number

## Description

Changes to the ECHCheck experiment.

* Replace default URL with cloudflare-ech.com
* Add support for performing an additional ECH handshake with a
different ClientHelloOuter SNI
* Randomize the order of the handshakes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants