diff --git a/tests_disabled.json b/tests_disabled.json index fe50ae41b..67cd4baa9 100644 --- a/tests_disabled.json +++ b/tests_disabled.json @@ -97,33 +97,9 @@ "name" : "tls.test_tls_handshake.TlsHandshakeTest.test_10byte_transfer", "reason" : "Bug #1324." }, - { - "name" : "tls.test_tls_handshake.TlsHandshakeTest.test_long_sni", - "reason" : "Bug #1308: Tempesta doesn't send TLS alerts." - }, - { - "name" : "tls.test_tls_handshake.TlsHandshakeTest.test_bad_sni", - "reason" : "Bug #1308: Tempesta doesn't send TLS alerts." - }, - { - "name" : "tls.test_tls_handshake.TlsHandshakeTest.test_bad_sign_algs", - "reason" : "Bug #1308: Tempesta doesn't send TLS alerts." - }, - { - "name" : "tls.test_tls_handshake.TlsHandshakeTest.test_bad_elliptic_curves", - "reason" : "Bug #1308: Tempesta doesn't send TLS alerts." - }, - { - "name" : "tls.test_tls_handshake.TlsHandshakeTest.test_bad_renegotiation_info", - "reason" : "Bug #1308: Tempesta doesn't send TLS alerts." - }, { "name" : "tls.test_tls_handshake.TlsVhostHandshakeTest.test_empty_sni_default", - "reason" : "Bug #1308: Tempesta doesn't send TLS alerts." - }, - { - "name" : "tls.test_tls_handshake.TlsHandshakeTest.test_many_ciphers", - "reason" : "Bug #1308: Tempesta doesn't send TLS alerts." + "reason" : "Bug #1347: Tempesta doesn't send TLS alerts on empty sni default." }, { "name" : "tls.test_tls_handshake.TlsHandshakeTest.test_fuzzing", diff --git a/tls/test_tls_handshake.py b/tls/test_tls_handshake.py index f89c49c68..9afb157f1 100755 --- a/tls/test_tls_handshake.py +++ b/tls/test_tls_handshake.py @@ -177,6 +177,22 @@ def test_alert(self): res = tls_conn._do_12_req() self.assertFalse(res, "Request processed on closed socket") + def test_close_notify(self): + self.start_all() + tls_conn = TlsHandshake() + with tls_conn.socket_ctx(): + self.assertTrue(tls_conn._do_12_hs(), "Can not connect to Tempesta") + res = tls_conn._do_12_req() + self.assertTrue(res, "Wrong request result: %s" % res) + tls_conn.send_12_alert(tls.TLSAlertLevel.WARNING, + tls.TLSAlertDescription.CLOSE_NOTIFY) + resp = tls_conn.sock.recvall(timeout=tls_conn.io_to) + self.assertTrue(resp.haslayer(tls.TLSAlert)) + if resp.haslayer(tls.TLSAlert): + alert = resp[tls.TLSAlert] + self.assertEqual(alert.level, 20) + self.assertEqual(alert.description, 3) + @util.profiled def test_fuzzing(self): """