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

SSL #1

Closed
seanmonstar opened this issue Sep 3, 2014 · 9 comments
Closed

SSL #1

seanmonstar opened this issue Sep 3, 2014 · 9 comments
Labels
A-server Area: server.

Comments

@seanmonstar
Copy link
Member

No description provided.

@seanmonstar seanmonstar added A-client Area: client. A-server Area: server. and removed A-client Area: client. labels Sep 10, 2014
@seanmonstar
Copy link
Member Author

ssl support for the client exists, still lacking server support

@cactorium
Copy link
Contributor

Is it alright if I take a stab at this?

@seanmonstar
Copy link
Member Author

@cactorium I'd be delighted if this showed up as a PR :D

Some notes: I'd imagine adding a pub fn https(ip: IpAddr, port: Port, cert: Path, key: Path) or something similar. The paths to the cert and key can be Options on the Server. The HttpListener would probably need to become an enum similar to HttpStream, and the Https variant accepting those Paths.

@cactorium
Copy link
Contributor

@seanmonstar Awesome :D

I think I did it? #199 I'm still working on figuring out how to test it, but here's something to look at for now

@veeti
Copy link

veeti commented Dec 31, 2014

What's the story for certificate validation in the client?

@cactorium
Copy link
Contributor

https://github.com/hyperium/hyper/blob/master/src/net.rs#L257 It looks like they're verified, peek around there and the openssl docs if you want more details: https://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html

@seanmonstar
Copy link
Member Author

@veeti
Copy link

veeti commented Dec 31, 2014

Thanks: so (rust-)openssl does verification, but is something required on the hyper side? I see there's no default verifier included and the provided client example accepts everything for me. Is this expected? Should I file a bug for this?

@seanmonstar
Copy link
Member Author

@veeti you can set a verifier function on Client. I guess a default could be similar to Python or nodejs.

Manishearth pushed a commit to Manishearth/hyper that referenced this issue Jan 12, 2015
Update servo branch for rust upgrade + rustc workaround for SendStr issue.
ayax79 pushed a commit to ayax79/hyper that referenced this issue Jan 14, 2015
Implements the missing enum cases in Http* and adds a new
method to the default Server implementation to take advantage
of the new TLS support

Closes hyperium#1
@ghost ghost mentioned this issue Jul 4, 2021
@ghost ghost mentioned this issue Oct 28, 2022
dicej added a commit to dicej/hyper that referenced this issue Dec 17, 2024
It's ugly, but here's what I did:

- Add `service::InformationalSender`, a type which wraps a
  `futures_channel::mspc::Sender<Response<()>>`.  This may be added as an
  extension to a `Request` by the Hyper server, and the application and/or
  middleware may use it to send one or more informational responses before
  sending the real one.

- Add code to proto::h1::dispatch and friends to add such an extension to each
  incoming request and then poll the `Receiver` end along with the future
  representing the final response.  If the app never sends any informational
  responses, then everything proceeds as normal.  Otherwise, we send those
  responses as they become available until the final response is ready.

TODO hyperium#1: Also support informatinal responses in the HTTP/2 server.
TODO hyperium#2: Come up with a less hacky API.

Signed-off-by: Joel Dice <[email protected]>
dicej added a commit to dicej/hyper that referenced this issue Dec 18, 2024
It's ugly, but here's what I did:

- Add `ext::InformationalSender`, a type which wraps a
  `futures_channel::mspc::Sender<Response<()>>`.  This may be added as an
  extension to an inbound `Request` by the Hyper server, and the application
  and/or middleware may use it to send one or more informational responses
  before sending the real one.

- Add code to proto::h1::dispatch and friends to add such an extension to each
  inbound request and then poll the `Receiver` end along with the future
  representing the final response.  If the app never sends any informational
  responses, then everything proceeds as normal.  Otherwise, we send those
  responses as they become available until the final response is ready.

TODO hyperium#1: Also support informational responses in the HTTP/2 server.
TODO hyperium#2: Come up with a less hacky API?

Signed-off-by: Joel Dice <[email protected]>
dicej added a commit to dicej/hyper that referenced this issue Dec 18, 2024
This is a prototype intended to spur discussion about what support for 1xx
informational responses should look like in a Hyper server.  The good news is
that it works great (for HTTP/1 only, so far).  The bad news is it's kind of
ugly.  Here's what I did:

- Add `ext::InformationalSender`, a type which wraps a
  `futures_channel::mspc::Sender<Response<()>>`.  This may be added as an
  extension to an inbound `Request` by the Hyper server, and the application
  and/or middleware may use it to send one or more informational responses
  before sending the real one.

- Add code to `proto::h1::dispatch` and friends to add such an extension to each
  inbound request and then poll the `Receiver` end along with the future
  representing the final response.  If the app never sends any informational
  responses, then everything proceeds as normal.  Otherwise, we send those
  responses as they become available until the final response is ready.

TODO hyperium#1: Also support informational responses in the HTTP/2 server.
TODO hyperium#2: Come up with a less hacky API?
TODO hyperium#3: Add test coverage.

Signed-off-by: Joel Dice <[email protected]>
dicej added a commit to dicej/hyper that referenced this issue Dec 18, 2024
This is a prototype intended to spur discussion about what support for 1xx
informational responses should look like in a Hyper server.  The good news is
that it works great (for HTTP/1 only, so far).  The bad news is it's kind of
ugly.  Here's what I did:

- Add `ext::InformationalSender`, a type which wraps a
  `futures_channel::mspc::Sender<Response<()>>`.  This may be added as an
  extension to an inbound `Request` by the Hyper server, and the application
  and/or middleware may use it to send one or more informational responses
  before sending the real one.

- Add code to `proto::h1::dispatch` and friends to add such an extension to each
  inbound request and then poll the `Receiver` end along with the future
  representing the final response.  If the app never sends any informational
  responses, then everything proceeds as normal.  Otherwise, we send those
  responses as they become available until the final response is ready.

TODO hyperium#1: Also support informational responses in the HTTP/2 server.
TODO hyperium#2: Come up with a less hacky API?
TODO hyperium#3: Add test coverage.

Signed-off-by: Joel Dice <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-server Area: server.
Projects
None yet
Development

No branches or pull requests

3 participants