aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-04-28 17:35:08 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2015-04-28 17:35:08 -0400
commit813c3280a47dfb163367cc12e7b85e6f301a7695 (patch)
tree40385fb33c3ecf0581c901bff694f39ca284a042 /tests
parent9ef13b9e23396f56420ef2aa3334d8c8af50bc73 (diff)
parentb8ef82e3f7aba8c1fce95a4f65bd655790ad1e45 (diff)
downloadcryptography-813c3280a47dfb163367cc12e7b85e6f301a7695.tar.gz
cryptography-813c3280a47dfb163367cc12e7b85e6f301a7695.tar.bz2
cryptography-813c3280a47dfb163367cc12e7b85e6f301a7695.zip
Merge pull request #1862 from reaperhulk/san-uri
add URI general name support
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 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",
+ ]