aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-04-21 20:28:01 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2015-04-21 20:28:01 -0400
commit7f817d5262084fcb01fc8b8a1a4f9728e7887bff (patch)
tree6bd82c5b68a8f1921a689504e18dd1f23d314d55 /tests
parent42363224318ead52cad80604622131d379a767a7 (diff)
parentfda410e06c6b82878f943273b29b55b41217dc74 (diff)
downloadcryptography-7f817d5262084fcb01fc8b8a1a4f9728e7887bff.tar.gz
cryptography-7f817d5262084fcb01fc8b8a1a4f9728e7887bff.tar.bz2
cryptography-7f817d5262084fcb01fc8b8a1a4f9728e7887bff.zip
Merge pull request #1855 from reaperhulk/subject-alt-name
Support Subject Alternative Name in the OpenSSL backend
Diffstat (limited to 'tests')
-rw-r--r--tests/test_x509_ext.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py
index 8516a339..2fa659ef 100644
--- a/tests/test_x509_ext.py
+++ b/tests/test_x509_ext.py
@@ -730,3 +730,24 @@ class TestSubjectAlternativeName(object):
assert repr(san) == (
"<SubjectAlternativeName([<DNSName(value=cryptography.io)>])>"
)
+
+
+@pytest.mark.requires_backend_interface(interface=RSABackend)
+@pytest.mark.requires_backend_interface(interface=X509Backend)
+class TestRSASubjectAlternativeNameExtension(object):
+ def test_dns_name(self, backend):
+ cert = _load_cert(
+ os.path.join("x509", "cryptography.io.pem"),
+ x509.load_pem_x509_certificate,
+ backend
+ )
+ ext = cert.extensions.get_extension_for_oid(
+ x509.OID_SUBJECT_ALTERNATIVE_NAME
+ )
+ assert ext is not None
+ assert ext.critical is False
+
+ san = ext.value
+
+ dns = san.get_values_for_type(x509.DNSName)
+ assert dns == [u"www.cryptography.io", u"cryptography.io"]