hyper-rustls icon indicating copy to clipboard operation
hyper-rustls copied to clipboard

Server boilerplate

Open andrewbaxter opened this issue 3 years ago • 2 comments

Is there a reason beyond "nobody's done it yet" that TlsAcceptor and TlsStream from the server example aren't published by this library? As it is hyper-rustls doesn't directly connect hyper and rustls.

Also it looks like the HTTP2 ALPN negotiation is on by default for the client per https://github.com/rustls/hyper-rustls/pull/95 but not the server (by the example) -- is there a reason for this?

andrewbaxter avatar Sep 10 '22 17:09 andrewbaxter

Excuse me, it looks like TlsAcceptor + is provided by this library, but it looks fairly different. I'm still trying to connect things together. Is this functionally the same TlsAcceptor as in the server example?

andrewbaxter avatar Sep 10 '22 17:09 andrewbaxter

Lots of people have done it. I think the main reason is that the server has to provide certificates somehow, and there often isn't one obvious way to do this -- the certificates probably need to be renewed as they expire and a server might need to provide certificates for multiple host names, which have to come from somewhere. There's just more degrees of freedom in a server implementation, so providing a generically useful API isn't quite straightforward and/or quite a bit of work.

djc avatar Sep 19 '22 10:09 djc