59 Commits

Author SHA1 Message Date
HoneyryderChuck
f9a6aab475 add the no-sni-with-san-check test 2023-09-08 23:29:12 +01:00
HoneyryderChuck
487a747544 allow reuse of previously closed connections within the scope of a session
when closed, connections are now placed in a place called eden_connections; whenever a connection is matched for, after checking the live connections and finding none, a match is looked in eden connections; the match is accepted **if** the IP is considered fresh (the input is validated in the cache, or input was an ip or in /etc/hosts, or it's an external socket) and, if a TLS connection, the stored TLS session did not expire; if these conditions do not match, the connection is dropped from the eden and a new connection will started instead; this will therefore allow reusing ruby objects, reusing TLS sessions, and still respect the DNs cache
2023-09-06 22:09:56 +01:00
HoneyryderChuck
ef2f0cc998 ssl: support session resumption on reconnections with same session
when connections get reset due to max number of requests being reached,
the same TLS session is going to be reused, as long as it's valid.

This change is ported from the same feature in net-http, including [the
tls 1.3
improvements](ddf5c52b5f)
2023-09-06 22:09:56 +01:00
HoneyryderChuck
0f988e3e9f adding session lifecycle callbacks 2023-05-31 20:06:59 +01:00
HoneyryderChuck
af38476a14 test for oauth plugin 2023-05-25 16:37:22 +01:00
HoneyryderChuck
a3add3c721 Merge branch 'fix-no-proxy' into 'master'
fix proxy discovery using proxy env vars

See merge request os85/httpx!242
2023-04-24 10:35:47 +00:00
HoneyryderChuck
092e594a4b Request.verb is now an upcased string (ex: "GET")
The reference for a request verb is now the string which is used
everywhere else, instead of the symbol corresponding to it. This was an
artifact from the import from httprb, and there is no advantage in it,
since these strings are frozen in most use cases, and the
transformations from symbol to strings being performed everywhere are
prooof that keeping the atom isn't really bringing any benefit.
2023-04-17 16:54:31 +03:00
HoneyryderChuck
df26c97e38 changed http based tests, added #scheme, using it to correctly set no proxy domain 2023-03-29 23:00:50 +01:00
HoneyryderChuck
eb3d3f9048 implementation of the webdav plugin 2022-08-13 15:30:37 +01:00
HoneyryderChuck
c31ded54e1 circuit breaker plugin 2022-08-07 22:24:57 +01:00
HoneyryderChuck
a316b31e7d fix: SNI is now disabled when the URL host is an IP 2022-05-07 18:17:47 +01:00
HoneyryderChuck
5307b33cb6 more timmeout leeway, using Thread.kill instead (truffleruby tests) 2022-03-29 22:55:01 +01:00
HoneyryderChuck
e9a81d6b16 enabled h2 tests which were blocked for jruby 2022-03-05 17:33:37 +00:00
HoneyryderChuck
91a106db54 log test improvements: test with higher level, test tty and non-tty 2022-01-16 02:29:38 +02:00
HoneyryderChuck
5a61586fd5 do not ignore goaway with no errors sent by the server, let the connection go down
raise a specific error for this, which will make it easier to rescue
from.
2021-11-18 18:07:12 +00:00
HoneyryderChuck
f31b06c150 improving servlet layer to be able to quickly build an HTTP2 test server 2021-11-17 21:34:16 +00:00
HoneyryderChuck
a60fde07d6 added plugin tests, and the plugin body 2021-10-01 23:38:38 +01:00
HoneyryderChuck
13e865e488 hiding monotonic time funcs under the utils API 2021-09-20 16:16:20 +01:00
HoneyryderChuck
c95e926886 auto-corrected the easy ones first 2021-09-03 12:24:18 +01:00
HoneyryderChuck
a0ac3354dc disabling grpc for truffleruby 2021-05-31 13:55:18 +01:00
HoneyryderChuck
77c86c0c22 added test to check whether client times out on settings 2021-05-29 22:53:14 +01:00
HoneyryderChuck
ff5ed7be59 added support for TLS channel credentials 2021-05-20 00:59:14 +01:00
HoneyryderChuck
7a60346bf7 Added trailer header support for writing requests
Request can also add their own trailer headers, either explicitly via
Request#trailers , or via request lifecycle callbacks
2021-05-06 10:38:20 +01:00
HoneyryderChuck
00faafddc9 added tests around the tcp connect errors 2021-03-11 17:58:24 +00:00
HoneyryderChuck
a03e93e531 allow for oportunistic upgrades, such as the apache Upgrade: h2
this is achieved by a rework of the upgrade plugin, and the addition of
an h2 upgrade plugin. The idea is the following: if a response carries
an Upgrade header, and there's a handler for it, we should go for it.
The difference is:

* when the response is 101, this means that the negotiation must take
  place before the actual response comes in;
* when the response is 200, upgrading means reconnecting to the channel,
  and assume the new protocol for subsequent requests only.
2021-03-05 12:23:17 +00:00
HoneyryderChuck
463dad46cb added the aws signature on top of the aws-sigv4 plugin, with support for using aws-sdk-core ready-made config 2021-02-02 18:33:24 +00:00
HoneyryderChuck
2866b78572 error message for sni is actually different, and I'm not sure how wasn't this being skipped 2021-01-31 15:51:34 +00:00
HoneyryderChuck
2ecfde95d8 fixing cerfificate hostname validation callback 2021-01-31 15:51:34 +00:00
HoneyryderChuck
384d273715 new ssl option: :hostname -> the SNI hostname used in the TLS handshake 2021-01-31 15:51:34 +00:00
HoneyryderChuck
fab44b5993 verifyig error responses annd deltas using internal methods 2021-01-05 18:57:39 +00:00
HoneyryderChuck
a6176ec01f using session pool for coalescing test, thereby minimizing interference (although it would have been nice to have more entropy) 2021-01-05 10:38:28 +00:00
HoneyryderChuck
cdf6868059 moar logging 2021-01-04 19:12:25 +00:00
HoneyryderChuck
a1b27f5349 make origins comparison less flakey 2021-01-04 19:08:01 +00:00
HoneyryderChuck
2853cde6db mapping origins correctly now 2021-01-04 19:01:03 +00:00
HoneyryderChuck
8a570f7d4c fixing location of origins var 2021-01-04 18:53:54 +00:00
HoneyryderChuck
1537ffb10f improving error message of coalescing test 2021-01-04 18:47:49 +00:00
HoneyryderChuck
035eda1f95 fixed another loop caused by certain connection goaway frames from
server not being processed

While introducing yet another test to catch frame processing errors, in
this case with the SETTINGS_TIMEOUT error, another loop was found. It
was caused by two reasons:

* connection was signaling it was "closing" on such an error, which is
  not really true (server already closed the stream, so no need to
  close it again); it should be marked as closed instead.
* write buffer was still full (with the handshake in this case), so the
  connection was still trying to write;
2020-11-27 13:47:36 +00:00
HoneyryderChuck
e6c9bb4714 fix: http/1.1 recover from connection exhausted
While adding the test, the code to recover from an exhausted HTTP/1.1
connection proved not to be reliable, as it wasn't taking inflight
requests nor update-once keep-alive max requests counters into
account.

This has been fixed by implementing our own test dummy using
webrick.
2020-11-26 20:11:30 +00:00
HoneyryderChuck
7f9e68ba3b fixed: session hangs when HTTP/2 receives a 421
While adding a test, a bug was found, where an HTTP/2 connection
receiving a 421 response wasn't redirecting the request well to an
HTTP/1.1 one. This has been fixed by changing the way a new connection
is instantiated.
2020-11-26 17:13:02 +00:00
HoneyryderChuck
322aa06f22 added a test for when an http/2 connection exhausts and a second connection has to be established 2020-11-26 17:12:09 +00:00
HoneyryderChuck
1b29e062a0 added streaming plugin tests 2020-11-22 22:32:38 +00:00
HoneyryderChuck
1b26977d16 updated rubocop to 1.0.0 on possible rubies, making the necessary changes 2020-11-07 15:36:21 +00:00
HoneyryderChuck
62467ff5c5 persistent and retries plugin now work well together
When persistent and retries are loaded separately, the options won't be
just overwritten; instead, changes will be kept, and max_retries will be
the max value of what both plugins load (in case the user sets its own
option)
2020-11-05 16:20:16 +00:00
HoneyryderChuck
1934e84bcd added the rate limiter tests 2020-10-31 01:08:44 +00:00
HoneyryderChuck
926ad27011 expect plugin
this plugin sets all body requests to send the expect-100 header before
sending any payload, a la curl. It recovers from 417 as well.
2020-03-10 18:57:42 +00:00
HoneyryderChuck
ae3cbac91d disabling connect timeout for CI 2020-01-12 21:42:12 +00:00
HoneyryderChuck
e61e9e1abe ignore these for jruby as well 2020-01-12 21:20:22 +00:00
HoneyryderChuck
1520acd91c only test alpn check for ruby > 2.2 2020-01-12 20:50:56 +00:00
HoneyryderChuck
9955c2ba80 testing log output, which allowed to remove a few more nocovs 2020-01-12 18:53:23 +00:00
HoneyryderChuck
066ff44762 moved timeout tests to the session, as they are not supposed to be differentiated in http/https terms 2019-12-31 01:57:00 +00:00