Run all HTTP SSL tests against both HTTP versions, too#699
Run all HTTP SSL tests against both HTTP versions, too#699DerGuteMoritz merged 7 commits intomasterfrom
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! |
…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-serversmacro which works likewith-http-serversbut with SSL enabled for both versions. It also sets*use-tls* trueby default.This also fixes some tests which were passing
http1-ssl-server-optionstowith-http-servers. This resulted in them running only against HTTP/1 (twice) because the:ssl-contextofwith-http2-serverwould get overridden.With this change,
test-ssl-session-accessis failing in the HTTP/2 case. This is because it callshttp.core/ring-request-ssl-sessionon 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