-
Notifications
You must be signed in to change notification settings - Fork 891
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 preliminary rustls support #572
Conversation
cc #568 |
{ | ||
fn write(&mut self, buf: &[u8]) -> IoResult<usize> { | ||
self.0.lock() | ||
.map_err(|_| io::Error::new(io::ErrorKind::Other, NativeSslPoisonError)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The map_err
here is kinda repetitive, perhaps it could be refactored?
Looks pretty good to me, modulo error handling. I'd be somewhat wary of making this too general as in the limit it'd just be recreating something like curl/hyper, as they're in theory the "general abstraction" for downloading crates. |
Builds on #570.
This doesn't actually work yet, but it makes rustls an optional dependency. If you build with
--feature=rustls-backend
then run withRUSTUP_USE_RUSTLS
it will use https://github.com/ctz/rustls with hyper. Next step is to write code to load the system root cert store.At the moment this is using my fork of rustls that adds a concurrency fix.
r? @alexcrichton
cc @ctz @briansmith