Fixing an issue were extensions were implicitly required

This commit is contained in:
kevgliss 2015-08-22 10:22:36 -07:00
parent 3df50f15f7
commit a07db5625b
1 changed files with 11 additions and 10 deletions

View File

@ -320,17 +320,18 @@ def create_csr(csr_config):
x509.BasicConstraints(ca=False, path_length=None), critical=True, x509.BasicConstraints(ca=False, path_length=None), critical=True,
) )
for k, v in csr_config.get('extensions', {}).items(): if csr_config.get('extensions'):
if k == 'subAltNames': for k, v in csr_config.get('extensions', {}).items():
# map types to their x509 objects if k == 'subAltNames':
general_names = [] # map types to their x509 objects
for name in v['names']: general_names = []
if name['nameType'] == 'DNSName': for name in v['names']:
general_names.append(x509.DNSName(name['value'])) if name['nameType'] == 'DNSName':
general_names.append(x509.DNSName(name['value']))
builder = builder.add_extension( builder = builder.add_extension(
x509.SubjectAlternativeName(general_names), critical=True x509.SubjectAlternativeName(general_names), critical=True
) )
# TODO support more CSR options, none of the authority plugins currently support these options # TODO support more CSR options, none of the authority plugins currently support these options
# builder.add_extension( # builder.add_extension(