ploxiln: just one test failure on Python 2.7.8:

```
FAIL: test_connection_refused (tornado.test.iostream_test.TestIOStream)
...
tornado/test/iostream_test.py", line 240, in test_connection_refused
    self.assertFalse(self.connect_called)
AssertionError: True is not false
```
diff --git a/tornado/http1connection.py b/tornado/http1connection.py
index c6d3e336..b7a62b8c 100644
--- a/tornado/http1connection.py
+++ b/tornado/http1connection.py
@@ -357,6 +357,10 @@ class HTTP1Connection(httputil.HTTPConnection):
                 # Applications are discouraged from touching Transfer-Encoding,
                 # but if they do, leave it alone.
                 'Transfer-Encoding' not in headers)
+            # If connection to a 1.1 client will be closed, inform client
+            if (self._request_start_line.version == 'HTTP/1.1' and
+                self._disconnect_on_finish):
+                headers['Connection'] = 'close'
             # If a 1.0 client asked for keep-alive, add the header.
             if (self._request_start_line.version == 'HTTP/1.0' and
                 (self._request_headers.get('Connection', '').lower() ==
@@ -418,7 +422,7 @@ class HTTP1Connection(httputil.HTTPConnection):
     def write(self, chunk, callback=None):
         """Implements `.HTTPConnection.write`.
 
-        For backwards compatibility is is allowed but deprecated to
+        For backwards compatibility it is allowed but deprecated to
         skip `write_headers` and instead call `write()` with a
         pre-encoded header block.
         """
diff --git a/tornado/httpserver.py b/tornado/httpserver.py
index 7a7d08cd..95273a36 100644
--- a/tornado/httpserver.py
+++ b/tornado/httpserver.py
@@ -154,7 +154,6 @@ class HTTPServer(TCPServer, Configurable,
                    max_body_size=None, max_buffer_size=None,
                    trusted_downstream=None):
         self.request_callback = request_callback
-        self.no_keep_alive = no_keep_alive
         self.xheaders = xheaders
         self.protocol = protocol
         self.conn_params = HTTP1ConnectionParameters(

http1connection: Send `Connection: close` before closing connection
From https://github.com/tornadoweb/tornado/pull/1963#issuecomment-305983002

When the client sends `Connection: close`, Tornado (correctly) responds by closing the connection after sending the response. [RFC 7230 section 6.6](https://tools.ietf.org/html/rfc7230#section-6.6) says that a server SHOULD set the `Connection: close` header in the response when it does so. 
diff --git a/tornado/test/httpserver_test.py b/tornado/test/httpserver_test.py
index f5f91a9d..d8342f74 100644
--- a/tornado/test/httpserver_test.py
+++ b/tornado/test/httpserver_test.py
@@ -719,6 +719,7 @@ class KeepAliveTest(AsyncHTTPTestCase):
         self.stream.read_until_close(callback=self.stop)
         data = self.wait()
         self.assertTrue(not data)
+        self.assertEqual(self.headers['Connection'], 'close')
         self.close()
 
     # keepalive is supported for http 1.0 too, but it's opt-in

pip install -e .[dev]
parse_log_pytest
requirements.txt
coverage codecov pytest
apt-get update apt-get install -y gcc
3.6
requirements/base.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==22.2.0
certifi==2021.5.30
charset-normalizer==2.0.12
codecov==2.1.13
coverage==6.2
idna==3.10
importlib-metadata==4.8.3
iniconfig==1.1.1
packaging==21.3
pluggy==1.0.0
py==1.11.0
pyparsing==3.1.4
pytest==7.0.1
requests==2.27.1
tomli==1.2.3
-e git+https://github.com/tornadoweb/tornado.git@62e47215ce12aee83f951758c96775a43e80475b#egg=tornado
typing_extensions==4.1.1
urllib3==1.26.20
zipp==3.6.0

name: tornado
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - charset-normalizer==2.0.12
      - codecov==2.1.13
      - coverage==6.2
      - idna==3.10
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - requests==2.27.1
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/tornado

tornado/test/httpserver_test.py::KeepAliveTest::test_request_close
tornado/test/httpserver_test.py::HTTPServerRawTest::test_invalid_content_length tornado/test/httpserver_test.py::HTTPServerRawTest::test_malformed_first_line tornado/test/httpserver_test.py::HTTPServerRawTest::test_malformed_headers tornado/test/httpserver_test.py::UnixSocketTest::test_unix_socket_bad_request tornado/test/httpserver_test.py::BodyLimitsTest::test_body_size_override_reset tornado/test/httpserver_test.py::BodyLimitsTest::test_large_body_buffered tornado/test/httpserver_test.py::BodyLimitsTest::test_large_body_buffered_chunked tornado/test/httpserver_test.py::BodyLimitsTest::test_large_body_streaming tornado/test/httpserver_test.py::BodyLimitsTest::test_large_body_streaming_chunked tornado/test/httpserver_test.py::BodyLimitsTest::test_timeout
tornado/test/httpserver_test.py::SSLv23Test::test_error_logging tornado/test/httpserver_test.py::SSLv23Test::test_large_post tornado/test/httpserver_test.py::SSLv23Test::test_non_ssl_request tornado/test/httpserver_test.py::SSLv23Test::test_ssl tornado/test/httpserver_test.py::SSLv3Test::test_error_logging tornado/test/httpserver_test.py::SSLv3Test::test_large_post tornado/test/httpserver_test.py::SSLv3Test::test_non_ssl_request tornado/test/httpserver_test.py::SSLv3Test::test_ssl tornado/test/httpserver_test.py::TLSv1Test::test_error_logging tornado/test/httpserver_test.py::TLSv1Test::test_large_post tornado/test/httpserver_test.py::TLSv1Test::test_non_ssl_request tornado/test/httpserver_test.py::TLSv1Test::test_ssl tornado/test/httpserver_test.py::SSLContextTest::test_error_logging tornado/test/httpserver_test.py::SSLContextTest::test_large_post tornado/test/httpserver_test.py::SSLContextTest::test_non_ssl_request tornado/test/httpserver_test.py::SSLContextTest::test_ssl tornado/test/httpserver_test.py::BadSSLOptionsTest::test_missing_arguments tornado/test/httpserver_test.py::BadSSLOptionsTest::test_missing_key tornado/test/httpserver_test.py::HTTPConnectionTest::test_100_continue tornado/test/httpserver_test.py::HTTPConnectionTest::test_multipart_form tornado/test/httpserver_test.py::HTTPConnectionTest::test_newlines tornado/test/httpserver_test.py::HTTPServerTest::test_double_slash tornado/test/httpserver_test.py::HTTPServerTest::test_empty_post_parameters tornado/test/httpserver_test.py::HTTPServerTest::test_empty_query_string tornado/test/httpserver_test.py::HTTPServerTest::test_malformed_body tornado/test/httpserver_test.py::HTTPServerTest::test_query_string_encoding tornado/test/httpserver_test.py::HTTPServerTest::test_types tornado/test/httpserver_test.py::HTTPServerRawTest::test_chunked_request_body tornado/test/httpserver_test.py::HTTPServerRawTest::test_chunked_request_uppercase tornado/test/httpserver_test.py::HTTPServerRawTest::test_empty_request tornado/test/httpserver_test.py::XHeaderTest::test_ip_headers tornado/test/httpserver_test.py::XHeaderTest::test_scheme_headers tornado/test/httpserver_test.py::XHeaderTest::test_trusted_downstream tornado/test/httpserver_test.py::SSLXHeaderTest::test_request_without_xprotocol tornado/test/httpserver_test.py::ManualProtocolTest::test_manual_protocol tornado/test/httpserver_test.py::UnixSocketTest::test_unix_socket tornado/test/httpserver_test.py::KeepAliveTest::test_cancel_during_download tornado/test/httpserver_test.py::KeepAliveTest::test_finish_while_closed tornado/test/httpserver_test.py::KeepAliveTest::test_http10 tornado/test/httpserver_test.py::KeepAliveTest::test_http10_keepalive tornado/test/httpserver_test.py::KeepAliveTest::test_http10_keepalive_extra_crlf tornado/test/httpserver_test.py::KeepAliveTest::test_keepalive_chunked tornado/test/httpserver_test.py::KeepAliveTest::test_pipelined_cancel tornado/test/httpserver_test.py::KeepAliveTest::test_pipelined_requests tornado/test/httpserver_test.py::KeepAliveTest::test_two_requests tornado/test/httpserver_test.py::GzipTest::test_gzip tornado/test/httpserver_test.py::GzipTest::test_uncompressed tornado/test/httpserver_test.py::GzipUnsupportedTest::test_gzip_unsupported tornado/test/httpserver_test.py::GzipUnsupportedTest::test_uncompressed tornado/test/httpserver_test.py::StreamingChunkSizeTest::test_chunked_body tornado/test/httpserver_test.py::StreamingChunkSizeTest::test_chunked_compressed tornado/test/httpserver_test.py::StreamingChunkSizeTest::test_compressed_body tornado/test/httpserver_test.py::StreamingChunkSizeTest::test_regular_body tornado/test/httpserver_test.py::MaxHeaderSizeTest::test_large_headers tornado/test/httpserver_test.py::MaxHeaderSizeTest::test_small_headers tornado/test/httpserver_test.py::IdleTimeoutTest::test_idle_after_use tornado/test/httpserver_test.py::IdleTimeoutTest::test_unused_connection tornado/test/httpserver_test.py::BodyLimitsTest::test_large_body_streaming_chunked_override tornado/test/httpserver_test.py::BodyLimitsTest::test_large_body_streaming_override tornado/test/httpserver_test.py::BodyLimitsTest::test_small_body tornado/test/httpserver_test.py::LegacyInterfaceTest::test_legacy_interface
tornado/http1connection.py tornado/httpserver.py
tornado/http1connection.py tornado/httpserver.py