aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_x509_ext.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-04-20 15:00:16 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-04-20 22:12:32 -0500
commit40f8338e986610f57ef905e510e0bf8f796e43e8 (patch)
tree1b0444a8d78b9a85831c587ffaa0730a5524240a /tests/test_x509_ext.py
parentbd11e028dcf763171097f5366f87f95ad0371a03 (diff)
downloadcryptography-40f8338e986610f57ef905e510e0bf8f796e43e8.tar.gz
cryptography-40f8338e986610f57ef905e510e0bf8f796e43e8.tar.bz2
cryptography-40f8338e986610f57ef905e510e0bf8f796e43e8.zip
Support Subject Alternative Name in the OpenSSL backend
Adds only DNS support first
Diffstat (limited to 'tests/test_x509_ext.py')
-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"]