-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Exposing SslContext for flexibility (e.g. client-side certs, etc) #471
Comments
Another option I thought of: Also I forgot to cc @seanmonstar |
@mikedilger I'm not sure I follow. In |
|
Ohhh, I see what you mean. Ok, so the |
Allow a Server to operate without requiring the entire Server struct to move into the with_listener function (instead only the handler function needs to move). This, allows other members to not move, or move separately, which will be needed for the next commit. See hyperium#471
I'm glad I asked, because I hadn't thought of that. I did this in 3 commits. See PR #479 |
Allow a Server to operate without requiring the entire Server struct to move into the with_listener function (instead only the handler function needs to move). This, allows other members to not move, or move separately, which will be needed for the next commit. See hyperium#471
Currently,
net::HttpListener::https()
takes a certificate and a key, and sets up an SslContext with a lot of assumptions. For example, it sets the DEFAULT cipher list. It also sets SSL_VERIFY_NONE.This is called by
Server::listen_threads()
. I'm trying to make changes that allow the caller to pass in an SslContext.Currently the SSL configuration is declared when the Server is created, by passing a certificate and a key to
Server::https()
. Unfortunately this scheme will not direclty work with a passed inSslContext
, because if anSslContext
is setup in theServer
struct, it moves when passed on to HttpListener::https(), causing a "use of partially moved value" error. This cannot be solved viaclone()
becauseSslContext
does not implementclone()
.If
Server::listen_threads()
accepted the SSL information at that point (rather than owning it in it's struct), this would cause a lot of breaking changes.OTOH, If
HttpListener
kept a reference to anSslContext
(instead of owning it), it would propagate another annoying lifetime parameter over a lot of code.I don't see a clearly preferable way of implementing this. Given a preferred direction, I'd be happy to make the changes necessary.
The text was updated successfully, but these errors were encountered: