Support TLS v1.3 on all platforms#6053
Conversation
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6053 +/- ##
==========================================
- Coverage 89.96% 89.94% -0.02%
==========================================
Files 370 370
Lines 101930 101938 +8
Branches 101930 101938 +8
==========================================
- Hits 91702 91693 -9
- Misses 6678 6688 +10
- Partials 3550 3557 +7 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
|
@mgoldenberg FYI for the current situation on oauth2-rs: ramosbugs/oauth2-rs#334 (comment) |
Thank you, I should have put an update here! The Rust team discussed this comment yesterday and decided we'd wait a little to see if any information is released about the new crate.
If movement is slow, we'll follow the author's prescription of implementing the traits ourselves.
Footnotes |
There's an alpha implementation now ramosbugs/oauth2-rs#333 (comment) |
This crate is used instead of enabling the reqwest feature in the oauth2 crate, which allows later version of reqwest to be used. Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
|
@mgoldenberg As I explained in review, I don't think it's right to specify that aws-lc-sys doesn't use the OpenSSL license. In fact it does have parts covered by the OpenSSL license via aws-lc project. Could you please clarify why you did https://github.com/matrix-org/matrix-rust-sdk/pull/6053/changes/1b88edc8c6cc1e8470d09a165979af533a27d909..ec4f6af3acbcf827bde8b83e6e4e7d9ef0d9050e in the review? |
|
@ShadowRZ, I'm not sure I see a review from you? But at any rate, the Rust team recommended I use My understanding from the conversation was that the license could be recast based on the following statement from OpenSSL.
Presumably this is preferable because adding a new license might involve some legal hurdles? I'm not terribly familiar with licensing issues, etc. so I'm mostly just following guidance here. I'd be happy to change the |
Hywan
left a comment
There was a problem hiding this comment.
Thank you for the contribution! I would like to clarify why we have 2 versions of reqwest now? The number of dependencies have increased significantly, with a lot of duplicated dependencies. I reckon it's caused by the duplication of reqwest but I didn't check.
that is correct regarding OpenSSL, but reqwest 0.13 is using rustls with aws-lc by default and aws-lc is based on a specific version of BoringSSL, which was based on OpenSSL < 3.0. I raised the issue regarding reqwest / aws-lc again here: aws/aws-lc#2203 (comment) My understanding is, that as aws-lc is largely a fork/extension of BoringSSL which was licensed with OpenSSL this still applies to aws-lc until the maintainers of aws-lc change their licensing or clarify on this matter (which aws/aws-lc#2203 is all about). AFAIK the better option would be to not use reqwest with the default features, but try to use OpenSSL instead of rustls. I don't know if using Or just leave it as it is or set |
That's information that is easy to miss, thanks for raising this. In that case we can't allow this license without becoming GPL-incompatible. We'll have to pick a different default TLS backend. |
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
|
The Kotlin build failure in CI is due to aws/aws-lc-rs#1006. Fixes have been released, and also some workarounds are mentioned. But, it seems the licensing issue might mean we won't depend on |
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
Hywan
left a comment
There was a problem hiding this comment.
There we go. Can you rebase your fixup commits please?
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
5e75b4f to
8e33ea2
Compare
Rebasing the entire branch is a bit of a pain because of all the merges that have happened to keep this branch up to date, so I just reworded the fixup commit and rebased from there. If the commit history is feeling too messy, I can create a new branch with a cleaner history - just let me know! |
Note: this pull request has a companion pull request in the
complement-cryptorepository, which must be merged in conjunction with this one.Before merging, this should be tested in conjunction with the Element X iOS client to ensure that TLS v1.3 is working properly. @stefanceriu has agreed to work on this.
Overview
The primary change in this pull request upgrades the
reqwestdependency to its latest version, which defaults to usingrustlswith support forrustls-platform-verifierinstead ofnative-tls(seereqwest@0.13.0). The benefit here is thatrustlssupports TLS v1.3 on all platforms, whereasnative-tlsdoes not.Additionally, this pull request makes
rustlsthe default TLS implementation in all the crates in this repository.This will be particularly helpful with element-hq/element-x-ios#786.
Changes
reqwestbumped to0.13.1HttpSettings::make_clientoauth2-reqwestadded in favor ofoauth2/reqwestreqwest^0.13oauth2-reqwestis currently in alpha release, so it probably makes sense to let this stabilize a bit. For details, see incompatibility to reqwest 0.13 ramosbugs/oauth2-rs#333 (comment).getrandombumped to0.3.4oauth2@5.1.0proptestbumped to1.9.0getrandom@0.3.4rustlsthe default TLS implementationQuestions
Mirror feature flag names?
A number of feature flags have been replaced in the dependencies above.
reqwest/rustls-tls=>reqwest/rustls- this is simply a name change, but is semantically identical (seereqwest@0.13.0).getrandom/js=>getrandom/wasm_js- the semantics here have changed slightly, but it seems to just make it easier to enable thewasm_jsbackend (seegetrandom@0.3.4).At any rate, I have updated references to these flags in each of the various
Cargo.tomlfiles, but have not changed the names of our exposed features to mimic those in the dependencies.Any thoughts or preferences on whether to mirror those names? That would, of course, result in a breaking change.
Default to using
rustls? Deprecatenative-tls?Now that the dependencies have all been bumped, we can use
rustlson all platforms. Should this be the new default given thatnative-tlswill very likely never support TLS v1.3 on Apple devices? And shouldnative-tlsbe deprecated as a result?UPDATE: The consensus here seems to be that we should default to using
rustls, but thatnative-tlsshould still be available.Fixes #5800.
Signed-off-by: Michael Goldenberg m@mgoldenberg.net