Ensuring IPAddresses and IPNetworks are correctly serialized. (#818)
This commit is contained in:
parent
249ab23df4
commit
07969f7e10
|
@ -327,7 +327,12 @@ class SubjectAlternativeNameExtension(Field):
|
||||||
name_type = 'DNSName'
|
name_type = 'DNSName'
|
||||||
|
|
||||||
elif isinstance(name, x509.IPAddress):
|
elif isinstance(name, x509.IPAddress):
|
||||||
name_type = 'IPAddress'
|
if isinstance(value, ipaddress.IPv4Network):
|
||||||
|
name_type = 'IPNetwork'
|
||||||
|
else:
|
||||||
|
name_type = 'IPAddress'
|
||||||
|
|
||||||
|
value = str(value)
|
||||||
|
|
||||||
elif isinstance(name, x509.UniformResourceIdentifier):
|
elif isinstance(name, x509.UniformResourceIdentifier):
|
||||||
name_type = 'uniformResourceIdentifier'
|
name_type = 'uniformResourceIdentifier'
|
||||||
|
|
Loading…
Reference in New Issue