aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/x509.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py
index cdc0e430..898ab6c7 100644
--- a/src/cryptography/x509.py
+++ b/src/cryptography/x509.py
@@ -542,6 +542,12 @@ class IPAddress(object):
class SubjectAlternativeName(object):
def __init__(self, general_names):
+ if not all(isinstance(x, GeneralName) for x in general_names):
+ raise TypeError(
+ "Every item in the general_names list must be an "
+ "object conforming to the GeneralName interface"
+ )
+
self._general_names = general_names
def __iter__(self):