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

Support Encrypted Client Hello (formerly known as ESNI) #7482

Open
candrews opened this issue Oct 24, 2018 · 50 comments
Open

Support Encrypted Client Hello (formerly known as ESNI) #7482

candrews opened this issue Oct 24, 2018 · 50 comments
Labels
branch: master Merge to master branch triaged: feature The issue/pr requests/adds a feature

Comments

@candrews
Copy link

candrews commented Oct 24, 2018

Encrypted Client Hello is on the standards track and is already being deployed by big players.

Draft RFC: https://tools.ietf.org/html/draft-ietf-tls-esni

Championed by the EFF: https://www.eff.org/deeplinks/2018/09/esni-privacy-protecting-upgrade-https
Deployed by Cloudflare: https://blog.cloudflare.com/esni/
Cloudflare's technical details post: https://blog.cloudflare.com/encrypted-sni/
Supported by Firefox: https://blog.mozilla.org/security/2018/10/18/encrypted-sni-comes-to-firefox-nightly/
Supported by NSS: https://bugzilla.mozilla.org/show_bug.cgi?id=1495120
Work in Progress in picotls: h2o/picotls#155

🤞 this can be in OpenSSL 1.1.2 😄

@richsalz
Copy link
Contributor

Your wording implies that it's done, and will soon be a standard. It's not done, it's going to be changing, and yes OpenSSL should support it once it gets finalized.

@kaduk
Copy link
Contributor

kaduk commented Oct 26, 2018

Indeed; note that the intended status of the linked internet-draft is only Experimental; it is not intended to be on the standards track.
It will likely be changing more, and the risks and benefits are not terribly well understood yet.

@vcunat
Copy link

vcunat commented Oct 29, 2018

Nitpick: the link you provided wasn't the last version; that's probably here: https://tools.ietf.org/html/draft-ietf-tls-esni (just clicked a few times, no deep knowledge; EDITed as suggested, and it's in OP now anyway)

@richsalz
Copy link
Contributor

Leave off the trailing -XX part and you always get the latest version.

@sftcd
Copy link
Contributor

sftcd commented Dec 3, 2018

Hiya, I've coded up a proof-of-concept version of the client-side of ESNI for openssl. It works with the CloudFlare deployment and doesn't seem to fall over (but no guarantees:-). The code is here. I also tried to document the design. I hope to work with a student to do the server side and track changes in the Internet-draft as that progresses. Comments are v. welcome esp if there's stuff to do to make this more likely to end up useful for the project when the standard settles down.

@cayolblake
Copy link

@sftcd Is you code portable to BoringSSL ?

@sftcd
Copy link
Contributor

sftcd commented Jan 1, 2019

Dunno, sorry, haven't ever looked inside BoringSSL. Happy to play about and see if that's useful at some point and someone tells me how:-)

@J0WI
Copy link

J0WI commented Jan 30, 2019

State in Go golang/go#9671 (comment)

@J0WI
Copy link

J0WI commented May 14, 2019

@sftcd
Copy link
Contributor

sftcd commented Sep 4, 2019

Hiya, we've done some more work on our openssl fork that has ESNI support and on a curl fork that uses that. It's early days, but if anyone wants to try play with the build and give us feedback that'd be great. Here's HOWTO. If you find any issues with that you'd like to raise then please raise an issue in our openssl fork or curl fork, or send us mail at the addresses in the HOWTO. Thanks.

@sftcd
Copy link
Contributor

sftcd commented Sep 29, 2019

We've integrated our ESNI supporting fork with the lighttpd web server. Details here. Be interested if anyone has feedback on that.

@vcunat
Copy link

vcunat commented Jan 8, 2020

Safe? I believe, there's no (IETF-)standardized way to do ESNI yet, so it's necessarily an experiment that will need some (hopefully minor) tweaks before becoming stable. The IETF consensus seems to be moving towards using a different DNS RR to transport this piece of information. This record addresses more issues than just ESNI, but just as the previous one it hasn't been IANA-allocated yet.

@vcunat
Copy link

vcunat commented Jan 8, 2020

Yes, the number will change, and the DNS record as well. I don't know the plans of implementors (and those who've deployed it already) or even details of the TLS parts – perhaps the clients might probe for both records during some overlapping period 🤷‍♀️ EDIT: or more easily, the servers might publish the same key through all the different DNS records.

@sftcd
Copy link
Contributor

sftcd commented Jan 8, 2020 via email

@richsalz
Copy link
Contributor

richsalz commented Jan 8, 2020

For those who don't know, Stephen is a former IETF Security AD and a member of the Internet Architecture Board. Trust that he (and the project) will do the right thing :)

@sftcd
Copy link
Contributor

sftcd commented Aug 10, 2020 via email

@richsalz
Copy link
Contributor

ESNI has evolved and has become EncryptedClientHello, ECH. ECH is still being developed. I know @sftcd (who did the initial ESNI implementation) is very involved with ECH. Your pessimism is misguided, @Motophan

@candrews candrews changed the title Support ESNI Support Encrypted Client Hello (formerly known as ESNI) Sep 20, 2020
@mikhirev
Copy link

Meanwhile the Russian government is going to forbid ESNI/ECH and block websites using it. This would be unlikely to happen if there were working implementations widespread, but this surely will if discussion take a couple years more.

@vcunat
Copy link

vcunat commented Sep 22, 2020

They can surely block way faster and simpler than "we" can do widespread deployment (of anything).

@Motophan
Copy link

Motophan commented Sep 26, 2020

eSNI is already blocked by China. The only way is to use some kind of 1-TRR and certs in DNS.

That was less than 10 days, banking stuff stopped working so it works fine again.

ESNI has evolved and has become EncryptedClientHello, ECH. ECH is still being developed. I know @sftcd (who did the initial ESNI implementation) is very involved with ECH. Your pessimism is misguided, @Motophan

China CCP thanks you for not including this in your software with like a compile flag or something.

@Motophan
Copy link

Motophan commented Oct 10, 2020

Any updates on this? Look I feel like I am talking to a brick wall here. China uses network asics not general purpose computers to filter traffic. When they need to filter a new type of traffic they need to build new asics. This takes approximately 8 months if they are having political unrest or 18 months if they are doing it without spending money with reckless abandon on etching the asics.

Now why is this important?
If the protocol changes, even a little, it cannot be dpi'ed because the asics cant kick the packets off the network or insert incorrect data.

If implementation was widespread enough it would not be worth it to block. There is a reason why azure, a American company, is still not blocked. As blocking it would exceed the censorship value of the target.

Now why should "we" care. Our goverments are not doing this?
China has infinite money to throw at the GFW because they print the money they spend on it. They can spend any amount of money on it including devaluing their own currency. Cost means nothing to them.

China will kill you if it thinks you are a threat to the CCP. It does not need a trial. It does not need a hearing. If they even suspect dissidence you will be picked up by a van and no one will ever hear from you again.

Currently people buypass censorship in one of two ways:

1- cypher their traffic in a off the shelf cypher that is not currently able to be manipulated by the asics. Your traffic will look like VPN traffic and will be comparable to others who use the same cypher but will not be comparable to normal traffic.
2- cypher their traffic in a personal cypher that is not currently able to be manipulated by the asics. Your traffic will look like VPN traffic but will not comparable to others and will not be comparable to normal traffic.

Both of these are problematic in their implementation because they can tell you are using a vpn with the non-asic components of the GFW. They take your traffic and stenograph it if you have too much signal to noise.

TLS 1.3 echo is perfect unitl nullrouting it was doable (this has been reversed) due to
1- having asics capable of nullrouting this traffic
2- willing to deal with the loss of this type of traffic on the network
It turns out this traffic stopped a lot of forign banking from working so the decision was reversed and China is putting pressure on financial institutions to conduct business in China with a approved cypher list. (!!!! This was a guess, I am not actually sure what made them stop null routing this traffic but I believe in my heart this is what it was !!!!)

Why this should be approved
If adoption is widespread enough blocking this traffic will not be worth the value in maintaining censorship and this type of traffic is better.
1- its asic resistant as the protocol develops, meaning they would continually need to roll out new asics over and over for this traffic specifically.
2- its not fingerprintable as vpn traffic because it is not vpn traffic. The traffic is standardised traffic. The non-asic components will not be able to differentiate between your traffic and censored traffic exept at the IP endpoint level. They will block ASNs ip ranges or specific IP's but it takes longer for them to do this and is not always done as it has unintended consequences. (Block cloudflare = a lot of internet pipes go nowhere)

Approve this please.

@Motophan
Copy link

Checking to see if we can use ECH / ESNI yet?

@sftcd
Copy link
Contributor

sftcd commented Nov 27, 2022 via email

@vahidlazio
Copy link

vahidlazio commented Mar 9, 2023

Hi everyone,
I got couple of questions regarding the support for Encrypted Client Hello.
1- It was mentioned above the Chinese ban on ESNI and the fact that they can do the same ban for ECH. (they can tamper the client hello message and remove the ECH extension, so even if the GREASE data is sent, if the server can work with the remaining stuff, fine, if not, the ECH will fail)
I consider this a security flaw that a middle man can examine what kind of features the server support. is there any mechanism already in place to prevent this? (maybe a client_hello_hash sent back from the server hello message and client checks if the hashes are the same with what it sent to the server?)
2- We still need to send the outer SNI in the outer ClientHello to the server, (if the handshake with ECH Config fails, the server should be able to attempt to do the handshake with the outer SNI) something like public.blah.com. imagine my server goes behind the Cloudflare CDN, can it be that the outer SNI is public-ech.cloudflare.com? then it will be almost impossible for middle-man to understand which website i'm visiting. the censorship strategy will be like all or nothing.
3- the fact we need to still set the outer SNI in clear text makes the censor's efforts minimal to block the service entirely. imagine they have some sort of white-lists, google services are allowed in Google Cloud but the random websites which might be VPN's are blocked. with outer SNI this is simple. except that the server either sends back a self signed certificate for a self signed "google.com" and the client approves this very certificate. (which if that works, we can already do this). and then it rises the question that if we can't hide the service we are visiting, what's the point of ECH anyways?

please forgive the ignorance, tried to understand what is going on in general with ECH.
Thanks.

@TechnikEmpire
Copy link

Given the history on this post, now deleted, maybe we can use the example of people such as employers not being comfortable with ECH and how they would attempt to defeat it. I mean as an employer, there's not a chance that I'm letting anyone in my network with a Tor-esque protocol.

Frankly, if you can intercept DoH, you can still circumvent all of this, so you need to pin the cert used for DoH, in which case you just refuse to fulfill such requests and then this is still defeated. Essentially all the "magic" of this proposed system is just security through obscurity by fast rotating key exchange over DoH. It's not actually anything secure and won't protect a single person from oppressive regimes. Just want to clarify that. This is a joint business venture being written into crypto libs by companies who want to control vast real estate on the web.

@sftcd
Copy link
Contributor

sftcd commented Mar 9, 2023 via email

@vahidlazio
Copy link

thanks @sftcd !

--> Not quite. The ECH extension still sticks out but a middlebox
cannot just remove it and see the TLS session succeed.

IIRC the GREASE data will be sent with random values for ECH if the client version supports ECH even if the ECHConfig in the DNS records is not present. to make the client hello not stick out. basically the values of the extension are only semantically different making it hard for the censor to block it.

--> ECH will likely provide more benefit for those using a CDN
yes, where the cost of blocking the entire CDN may be too
high for a number of entities.

For cloudflare i used wireshark and it seems the ech public server name is something like cloudflare-ech.com which i think if they roll it out something like that will be for all the domains they host. If it's the same case for Google then the cost for the censor is blocking the whole google cloud which also includes Google services.

--> the server can publish the name it'd like
as the outer SNI in the DNS, and browsers will use that. 

but the restriction here is you need to own the domain that you put in the DNS HTTPS record and have a valid certificate for that, the client must abort the handshake if the certificate is not valid for the public name. here the client can accept the self signed certificate which you referred me to the RFC8744.

@vahidlazio
Copy link

by "stick out" i mean it won't be clear based on the client hello if the server supports the ECH and if the DNS record for the ECHConfig exists since the ECH extension (real or fake) will be sent if the client supports ECH. meaning if it becomes widely the standard in the clients, distinguishing it for the censor is hard.

@richsalz
Copy link
Contributor

richsalz commented Mar 9, 2023

This type of general discussion about the spec will be more effective if they are issues on the draft repository,https://github.com/tlswg/draft-ietf-tls-esni or the TLS mailing list (subscribe at https://www.ietf.org/mailman/listinfo/tls)

@sftcd
Copy link
Contributor

sftcd commented Mar 9, 2023 via email

@imsys
Copy link

imsys commented Jul 6, 2023

@sftcd Is you code portable to BoringSSL ?

draft-ietf-tls-esni-09: google/boringssl@00e434d
draft-ietf-tls-esni-10: google/boringssl@49ee62f
draft-ietf-tls-esni-13: google/boringssl@18b6836

There aren't any technical changes from draft 13 to 16, the diff is only editorial wording and keep-alive from draft expiration.

@imsys
Copy link

imsys commented Aug 2, 2023

From the IETF117 meeting:

  • Chrome and Firefox are doing a 1% sample trial.
  • They expect to submit to the IESG evaluation by January 2024.

Source:
https://datatracker.ietf.org/doc/minutes-117-tls-202307262000/
https://www.youtube.com/watch?v=oNoRithKw00

@sftcd
Copy link
Contributor

sftcd commented Aug 2, 2023 via email

@Tristan971
Copy link

Tristan971 commented Sep 29, 2023

Fyi, Chrome is shipping it in version 117 now: https://chromestatus.com/feature/6196703843581952
And Cloudflare has announced their rollout (essentially from ESNI to ECH): https://blog.cloudflare.com/announcing-encrypted-client-hello/

Firefox hasn't (to my knowledge) announced intent to ship to stable yet, but they're presumably not far behind.

@dennisjackson
Copy link

Firefox's intent to ship was sent in August: dev-platform

@wbl
Copy link
Contributor

wbl commented Oct 4, 2023

@sftcd Is there a PR submitted?

More generally I'd like to know what the prospect is of this landing comparatively soon/happy to review an API to see if it will work for us.

@immjs
Copy link

immjs commented Oct 4, 2023

Fyi, Chrome is shipping it in version 117 now: https://chromestatus.com/feature/6196703843581952
And Cloudflare has announced their rollout (essentially from ESNI to ECH): https://blog.cloudflare.com/announcing-encrypted-client-hello/

Firefox hasn't (to my knowledge) announced intent to ship to stable yet, but they're presumably not far behind.

https://blog.mozilla.org/en/products/firefox/encrypted-hello/

Mozilla has just announced support for ECH

@sftcd
Copy link
Contributor

sftcd commented Oct 4, 2023

Hiya,

@sftcd Is there a PR submitted?

Not yet. My understanding is that OpenSSL maintainers won't merge a PR until after the RFC has issued per their current policy. So I was planning to make a PR towards the end of this year in the hope that the stars might align not too long thereafter.

More generally I'd like to know what the prospect is of this landing comparatively soon/happy to review an API to see if it will work for us.

I'm fine with making a draft PR sooner if that's useful for getting review - would that be useful?

Or, for now the new APIs are in a separate header file if that's useful. I also have code (linked from defo.ie) showing how those APIs are used for curl, nginx, apache, haproxy and lighttpd if that's useful to review. (And I'd be delighted to get review of any of that)

S.

@wbl
Copy link
Contributor

wbl commented Oct 5, 2023

I'll leave it to others for the draft review: if there are draft docs as well as headers it might be helpful: sometimes it's tricky to see from just signature alone what's intended. Will send email soon.

@sftcd sftcd mentioned this issue Dec 4, 2023
2 tasks
@nhorman
Copy link
Contributor

nhorman commented Jun 16, 2024

we're planning to address this here:
openssl/project#892

will close this as a dup when we get started

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch: master Merge to master branch triaged: feature The issue/pr requests/adds a feature
Projects
None yet
Development

No branches or pull requests