mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
Read the request body before replying, and generate certificates portably
httpsrv parsed Content-Length and never read what followed. The reply is followed by a close, and closing a socket that still holds unread data resets the connection instead of ending it, so a POST could cost the client the reply it was about to read. Windows does that reliably; the same test passes on Linux and macOS, which is why it looked flaky. Drain the body, bounded at a megabyte. The test CA was built with -addext, which LibreSSL - the openssl on a stock macOS - does not apply the same way, leaving a certificate that is not usable as a CA and a client that cannot build a chain to it. Put the extensions in a file both accept, and verify the generated chain before any of it is handed to a proxy, so a failure there is not read as a fault in the proxy.
This commit is contained in:
1 parent
527f0704a4
commit
488317da1d
3 files changed
+72
-19
No files matched your search
@@ -16,6 +16,14 @@ def run(t):
|
||||
t.skip("TLS (openssl is not available to generate certificates)")
|
||||
return
|
||||
|
||||
# The key material has to be sound before anything is asked of the
|
||||
# proxy, or every failure below points at the wrong thing.
|
||||
if not certs.verified:
|
||||
t.fail("the generated certificate chain verifies", "OK",
|
||||
certs.verify_output or "openssl verify failed")
|
||||
return
|
||||
t.ok("the generated certificate chain verifies")
|
||||
|
||||
# --- a proxy wrapped in TLS (ssl_serv) ----------------------------
|
||||
origin = t.free_port()
|
||||
tlsproxy = t.free_port()
|
||||
|
||||
Reference in new issue
Block a user