diff options
author | Andrei Belov <defan@nginx.com> | 2021-08-19 18:17:12 +0300 |
---|---|---|
committer | Andrei Belov <defan@nginx.com> | 2021-08-19 18:17:12 +0300 |
commit | db442f1be7e713e6a219621ff97a51046590dbd6 (patch) | |
tree | 913734275bc890ec175e51fcb0f36b01a3c52c24 /test/test_tls_sni.py | |
parent | a1d2ced6fc2317d36bc917c5d0ac339bc647dc34 (diff) | |
parent | 13c0025dfa6e041563d0ad5dd81679b44522694c (diff) | |
download | unit-db442f1be7e713e6a219621ff97a51046590dbd6.tar.gz unit-db442f1be7e713e6a219621ff97a51046590dbd6.tar.bz2 |
Merged with the default branch.1.25.0-1
Diffstat (limited to 'test/test_tls_sni.py')
-rw-r--r-- | test/test_tls_sni.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/test_tls_sni.py b/test/test_tls_sni.py index 2e5424e2..eba6140a 100644 --- a/test/test_tls_sni.py +++ b/test/test_tls_sni.py @@ -168,6 +168,26 @@ basicConstraints = critical,CA:TRUE""" self.check_cert('alt2.example.com', bundles['example.com']['subj']) self.check_cert('blah', bundles['default']['subj']) + def test_tls_sni_no_hostname(self): + bundles = { + "localhost.com": {"subj": "localhost.com", "alt_names": []}, + "example.com": { + "subj": "example.com", + "alt_names": ["example.com"], + }, + } + self.config_bundles(bundles) + self.add_tls(["localhost.com", "example.com"]) + + resp, sock = self.get_ssl( + headers={'Content-Length': '0', 'Connection': 'close'}, start=True, + ) + assert resp['status'] == 200 + assert ( + sock.getpeercert()['subject'][0][0][1] + == bundles['localhost.com']['subj'] + ) + def test_tls_sni_upper_case(self): bundles = { "localhost.com": {"subj": "LOCALHOST.COM", "alt_names": []}, |