aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_x509_ext.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-04-22 16:04:24 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-04-28 09:41:26 -0500
commitb8ef82e3f7aba8c1fce95a4f65bd655790ad1e45 (patch)
tree3671edb28f83ee32cdfd539261ffd46272ea20ea /tests/test_x509_ext.py
parent2a5bb537fbfbc8ca59c6032c0a70c6e1e327701d (diff)
downloadcryptography-b8ef82e3f7aba8c1fce95a4f65bd655790ad1e45.tar.gz
cryptography-b8ef82e3f7aba8c1fce95a4f65bd655790ad1e45.tar.bz2
cryptography-b8ef82e3f7aba8c1fce95a4f65bd655790ad1e45.zip
add URI general name support
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 bce6781f..820e96b9 100644
--- a/tests/test_x509_ext.py
+++ b/tests/test_x509_ext.py
@@ -788,3 +788,24 @@ class TestRSASubjectAlternativeNameExtension(object):
san = ext.value
rid = san.get_values_for_type(x509.RegisteredID)
assert rid == [x509.ObjectIdentifier("1.2.3.4")]
+
+ def test_uri(self, backend):
+ cert = _load_cert(
+ os.path.join(
+ "x509", "custom", "san_uri_with_port.pem"
+ ),
+ x509.load_pem_x509_certificate,
+ backend
+ )
+ ext = cert.extensions.get_extension_for_oid(
+ x509.OID_SUBJECT_ALTERNATIVE_NAME
+ )
+ assert ext is not None
+ uri = ext.value.get_values_for_type(
+ x509.UniformResourceIdentifier
+ )
+ assert uri == [
+ u"gopher://\u043f\u044b\u043a\u0430.cryptography:70/path?q=s#hel"
+ u"lo",
+ u"http://someregulardomain.com",
+ ]