[projects/pld-builder.new] request_handler_server: end https replies with a TLS close_notify
arekm
arekm at pld-linux.org
Mon Oct 26 17:18:01 CET 2026
commit c165c5debf5003ca87467f7ae751826b2e2f79e7
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sat Oct 24 18:26:40 2026 +0200
request_handler_server: end https replies with a TLS close_notify
The connection was closed without one, so curl reported "unexpected
eof while reading" and failed even on a 200 reply.
PLD_Builder/request_handler_server.py | 11 +++++++++++
1 file changed, 11 insertions(+)
---
diff --git a/PLD_Builder/request_handler_server.py b/PLD_Builder/request_handler_server.py
index 0cc6abe..5315ff3 100644
--- a/PLD_Builder/request_handler_server.py
+++ b/PLD_Builder/request_handler_server.py
@@ -39,6 +39,17 @@ class ForkingHTTPServer(ForkingMixIn, HTTPServer):
signal.signal(signal.SIGINT, signal.SIG_DFL)
super().finish_request(request, client_address)
+ def shutdown_request(self, request):
+ # only the child that served the request gets here; end TLS with
+ # close_notify, or clients like curl report a truncated reply
+ if isinstance(request, ssl.SSLSocket):
+ try:
+ request.unwrap()
+ except OSError:
+ # the client is gone already; there is nobody to tell
+ pass
+ super().shutdown_request(request)
+
def about(filename):
# only file_sender names what it posts; make-request.sh does not
return filename + ": " if filename else ""
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/ce9feb3c796ed049b6dd260a50d94d80feb1656d
More information about the pld-cvs-commit
mailing list