summaryrefslogtreecommitdiffhomepage
path: root/test/test_tls_sni.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2021-07-23 15:37:03 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2021-07-23 15:37:03 +0100
commit960ffc99677b8451a3cc4ea7bc053b3c123e4e1b (patch)
tree84b042193040e7c5990f8ac20cbc9305e562a8f3 /test/test_tls_sni.py
parentf965e358b6ca878ead629dffb2f0df57230995ea (diff)
downloadunit-960ffc99677b8451a3cc4ea7bc053b3c123e4e1b.tar.gz
unit-960ffc99677b8451a3cc4ea7bc053b3c123e4e1b.tar.bz2
Tests: added SNI test without hostname in request.
Diffstat (limited to 'test/test_tls_sni.py')
-rw-r--r--test/test_tls_sni.py20
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": []},