-
Notifications
You must be signed in to change notification settings - Fork 241
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
Run all HTTP SSL tests against both HTTP versions, too #699
Run all HTTP SSL tests against both HTTP versions, too #699
Conversation
Oh yeah, this variable got me confused for a moment since I thoguht it would enable TLS in the servers, too. How about renaming it to |
Unfortunately I agree that functionality should be tested, though. Can you merge #698, or do you need someone else to do it? Also, are you trying one of the stack tools out? I noticed this is a branch off a branch. |
I see! How about exposing the channel via
Ah I thought you didn't already merge it because you wanted @arnaudgeiser to confirm it, too (which he did in the meantime 😄). Merged now!
Nope, in this case I just manually did it. And note what GH did after merging the other branch:
Pretty good! |
Just realized there is precedence of exposing it via |
To that end, introduce a new `with-http-ssl-servers` macro which works like `with-http-servers` but with SSL enabled for both versions. It also sets `*use-tls* true` by default. This also fixes some tests which were passing `http1-ssl-server-options` to `with-http-servers`. This resulted in them running only against HTTP/1 (twice) because the `:ssl-context` of `with-http2-server` would get overridden.
This makes `aleph.http.core/ring-request-ssl-session` work with HTTP/2 requests, too, since we no longer have to rely on the HTTP/1-only NettyRequest's `ch` field. However, since for HTTP/2 the `SslHandler` lives on the connection channel rather than the request's stream channel, we have to change `channel-ssl-session` to recur the channel ancestor chain to find it now.
Should make its purpose a bit more self-explanatory.
82a9a2b
to
74c93c8
Compare
Just pushed commits for both of these! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me
…y introduced ones Might later be refined e.g. by namespacing them with :aleph.internal/ instead. See #700 for future reconsideration.
To that end, introduce a new
with-http-ssl-servers
macro which works likewith-http-servers
but with SSL enabled for both versions. It also sets*use-tls* true
by default.This also fixes some tests which were passing
http1-ssl-server-options
towith-http-servers
. This resulted in them running only against HTTP/1 (twice) because the:ssl-context
ofwith-http2-server
would get overridden.With this change,
test-ssl-session-access
is failing in the HTTP/2 case. This is because it callshttp.core/ring-request-ssl-session
on the ring request. However, this fails because the HTTP/2 server implementation currently doesn't wrap the ring request inaleph.http.core/NettyRequest
. @KingMob Can we just change it to do that or is there a good reason for not doing so?Note: To avoid conflicts, this PR is based on #698