From d04b39b253916223e9dd99831586822a4f9a2fc1 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Tue, 21 Apr 2015 08:44:17 -0500 Subject: add a check to require that the list passed to SAN is all general names --- tests/test_x509_ext.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py index 8516a339..45d309db 100644 --- a/tests/test_x509_ext.py +++ b/tests/test_x509_ext.py @@ -721,6 +721,12 @@ class TestSubjectAlternativeName(object): x509.DNSName(six.u("crypto.local")), ] + def test_invalid_general_names(self): + with pytest.raises(TypeError): + x509.SubjectAlternativeName( + [x509.DNSName(six.u("cryptography.io")), "invalid"] + ) + def test_repr(self): san = x509.SubjectAlternativeName( [ -- cgit v1.2.3