Commit 626d9eb4 authored by Łukasz Nowak's avatar Łukasz Nowak

playbook: Prove that any host is ok for the server (https)

By adding Host: HTTP/1.1 header and checking the response the test
asserts, that server is able to serve on any hostname, which is
configured to server's IP address.

Note: skipped, as SSL is not fully configured on the server.
parent e3d6e719
......@@ -27,3 +27,21 @@ class TestSiteHttps(unittest.TestCase):
self.assertFalse(result.is_permanent_redirect)
self.assertEqual(result.status_code, 302)
self.assertTrue(result.headers['Location'].endswith('/erp5/login_form'))
@unittest.skip(
'Currently HTTPS will reply with "Hostname 172.16.0.9 provided via SNI '
'and hostname anyhost provided via HTTP are different"')
def test_https_erp5_anydomain(self):
"""HTTPS: Checks that any domain can be used"""
result = requests.get(
self.https_url + '/erp5/', verify=False, allow_redirects=False,
headers={'Host': 'anyhost'}
)
self.assertTrue(result.ok)
self.assertTrue(result.is_redirect)
self.assertFalse(result.is_permanent_redirect)
self.assertEqual(result.status_code, 302)
self.assertEqual(
result.headers['Location'],
'https://anyhost/erp5/login_form'
)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment