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 preliminary rustls support #572

Merged
merged 16 commits into from
Jul 11, 2016
Merged

Add preliminary rustls support #572

merged 16 commits into from
Jul 11, 2016

Conversation

brson
Copy link
Contributor

@brson brson commented Jul 10, 2016

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 with RUSTUP_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

@brson
Copy link
Contributor Author

brson commented Jul 10, 2016

cc #568

{
fn write(&mut self, buf: &[u8]) -> IoResult<usize> {
self.0.lock()
.map_err(|_| io::Error::new(io::ErrorKind::Other, NativeSslPoisonError))
Copy link
Member

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?

@alexcrichton
Copy link
Member

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.

@brson brson merged commit ee7dab8 into rust-lang:master Jul 11, 2016
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

Successfully merging this pull request may close these issues.

2 participants