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

Use reqwest w/ rusttls on Linux #1432

Closed
eoger opened this issue Jul 19, 2019 · 4 comments
Closed

Use reqwest w/ rusttls on Linux #1432

eoger opened this issue Jul 19, 2019 · 4 comments

Comments

@eoger
Copy link
Contributor

eoger commented Jul 19, 2019

Here's how our SSL stacks look like currently:

Platform SSL stack
Android (phones) viaduct -> GeckoView/NSS
Android (unit tests) viaduct (broken since not initialized?)
iOS (phones + simulator) nativetls > Secure Transport (OS)
Desktop (Win32) nativetls > Schannel (OS)
Desktop (macOS) nativetls > Secure Transport (OS)
Desktop (Linux) nativetls > OpenSSL

In order to get rid of OpenSSL completely, I'd like use to move Android (Unit tests - Linux) from native-tls which pulls OpenSSL to rustls (SSL stack written in Rust).

My plan was to add to viaduct's Cargo.toml something like this:

[target.'cfg(not(any(target_os = "windows", target_os = "macos", target_os = "ios")))'.dependencies]
# reqwest w/ rustls feature
[target.'cfg(any(target_os = "windows", target_os = "macos", target_os = "ios"))'.dependencies]
# Regular reqwest

But because of rust-lang/cargo#2524 we can't do that 🙁

┆Issue is synchronized with this Jira Task
┆Sprint: Backlog

@rfk
Copy link
Contributor

rfk commented Aug 13, 2019

As a kind scoping question...how necessary is it for our unit tests to actually hit the network? Would an alternate approach here be to rework our unittests to use mocked-out network calls rather than depending on a live network connection? (I'm sure that would be a much bigger task, just want to understand the alternatives).

@eoger
Copy link
Contributor Author

eoger commented Aug 14, 2019

Turns out our unit tests actually don't hit the network at all, I discovered that they are compiled with Viaduct support which doesn't get initialized in unit tests and still pass :)

@rfk
Copy link
Contributor

rfk commented Feb 13, 2020

Alternately, we could consider making an iOS backend for viaduct, and then switch to using reqwest-with-rusttls on all desktop platforms (where it's only used for testing).

@eoger
Copy link
Contributor Author

eoger commented Apr 20, 2020

We did what we wanted to do here, and the reqwest/native-tls-vendored feature allowed us to remove OpenSSL from our libs/ directory.
Furthermore viaduct-reqwest must be imported explicitely to use the reqwest backend of viaduct now, so there's no confusion possible.

@eoger eoger closed this as completed Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants