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

feat(server): Add an ssl example #1990

Closed
wants to merge 1 commit into from

Conversation

trezm
Copy link

@trezm trezm commented Oct 22, 2019

Adds an example using hyper + ssl for a server.

Should resolve the closed issue #1942

@shirshak55
Copy link

any reason to change 100644 → 100755 ?

Adds an example using hyper + ssl for a server.

Should resolve the closed issue hyperium#1942
@trezm
Copy link
Author

trezm commented Nov 14, 2019

Totally, not sure why/how the permissions go changed on these files! Updated accordingly.

@Darkspirit
Copy link

@trezm
Copy link
Author

trezm commented Nov 15, 2019

Note: I think this might currently be broken due to this change: 71d088d, at least until tokio updates their dependencies to future 0.3.1 as well.

@Darkspirit that's awesome!! If you'd like to replace this with an example from that repo that'd be great. It just seems like for such a simple setup there should be an example to point people towards if they happen to want to have SSL on their server.

@Darkspirit
Copy link

Thank you for trying to merge a tls server example at all! :) I would be very grateful if you could update this pull request to use (the well received) rustls instead of non-rusty native-tls. Rustls and its dependencies webpki and ring are for example used by time.cloudflare.com, Google Fuchsia and Baidu. (Ring is based on Boringssl, Google's improved fork of OpenSSL, but got lots of C and C++ replaced with Rust.) It's quite sad that native-tls is spreading a bit like cancer, especially because it doesn't use Rust at places where its safety guarantees are most useful.

@trezm
Copy link
Author

trezm commented Nov 16, 2019 via email

@trezm
Copy link
Author

trezm commented Jan 8, 2020

Checking back in on this -- I have a PR open to the tokio-tls repo to add rustls as a tls option. That being said, it looks like that might take a while to get in, which is unfortunate.

While experimenting though, I also noticed that the way the code is currently written, a long-lived http call will block request execution. Does anyone have any ideas around this? Basically because filter_map does not continue accepting sockets, we would need a stream op that always takes the next item and forms a new stream whose order is based on the completion time of an async closure run on each element of the original stream.

@twe4ked
Copy link

twe4ked commented Mar 13, 2020

This looks awesome, it would be great to have an SSL example in the repo. I've had a search around an most of the examples I found of SSL/hyper are outdated because the async code has been moving so fast. Any updates on this?

@trezm
Copy link
Author

trezm commented Mar 13, 2020 via email

@seanmonstar
Copy link
Member

Thanks for the PR! I'd rather not include examples in the hyper repo selecting specific TLS libraries. I think something like this could be part of hyper-tls, once it gains a server API.

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.

5 participants