vtls: revert "receive max buffer" + add test case

- add test_05_04 for requests using http/1.0, http/1.1 and h2 against an
  Apache resource that does an unclean TLS shutdown.
- revert special workarund in openssl.c for suppressing shutdown errors
  on multiplexed connections
- vlts.c restore to its state before 9a90c9dd64

Fixes #12885
Fixes #12844

Closes #12848
This commit is contained in:
Stefan Eissing 2024-02-01 18:15:50 +01:00 committed by Daniel Stenberg
parent 7cf8414fab
commit ed09a99af5
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
4 changed files with 41 additions and 24 deletions

View file

@ -108,3 +108,30 @@ class TestErrors:
r.check_response(http_status=200, count=1)
# check that we did a downgrade
assert r.stats[0]['http_version'] == '1.1', r.dump_logs()
# On the URL used here, Apache is doing an "unclean" TLS shutdown,
# meaning it sends no shutdown notice and just closes TCP.
# The HTTP response delivers a body without Content-Length. We expect:
# - http/1.0 to fail since it relies on a clean connection close to
# detect the end of the body
# - http/1.1 to work since it will used "chunked" transfer encoding
# and stop receiving when that signals the end
# - h2 to work since it will signal the end of the response before
# and not see the "unclean" close either
@pytest.mark.parametrize("proto", ['http/1.0', 'http/1.1', 'h2'])
def test_05_04_unclean_tls_shutdown(self, env: Env, httpd, nghttpx, repeat, proto):
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 10 if proto == 'h2' else 1
curl = CurlClient(env=env)
url = f'https://{env.authority_for(env.domain1, proto)}'\
f'/curltest/shutdown_unclean?id=[0-{count-1}]&chunks=4'
r = curl.http_download(urls=[url], alpn_proto=proto, extra_args=[
'--parallel',
])
if proto == 'http/1.0':
r.check_exit_code(56)
else:
r.check_exit_code(0)
r.check_response(http_status=200, count=count)