Hello,
I am trying to specify O and CN
authority_cert_issuer: ‘dirName:O = Example Net, CN = example.net’
authority_key_identifier: xxxxxxxx
authority_cert_serial_number: xxxxxxxxx
I get the following error on playbook run.
“msg”: “Cannot parse Subject Alternative Name "dirName:O = Packet Hosting" (potentially unsupported by cryptography backend)”
Here is the trace
The full traceback is:
WARNING: The below traceback may not be related to the actual failure.
File “/tmp/ansible_openssl_csr_payload_wKv9F1/ansible_openssl_csr_payload.zip/ansible/modules/crypto/openssl_csr.py”, line 1088, in main
File “/tmp/ansible_openssl_csr_payload_wKv9F1/ansible_openssl_csr_payload.zip/ansible/modules/crypto/openssl_csr.py”, line 541, in generate
File “/tmp/ansible_openssl_csr_payload_wKv9F1/ansible_openssl_csr_payload.zip/ansible/modules/crypto/openssl_csr.py”, line 812, in _generate_csr
File “/tmp/ansible_openssl_csr_payload_wKv9F1/ansible_openssl_csr_payload.zip/ansible/module_utils/crypto.py”, line 1772, in cryptography_get_name
raise OpenSSLObjectError(‘Cannot parse Subject Alternative Name “{0}” (potentially unsupported by cryptography backend)’.format(name))
`
`
def cryptography_get_name(name):
‘’’
Given a name string, returns a cryptography x509.Name object.
Raises an OpenSSLObjectError if the name is unknown or cannot be parsed.
‘’’
try:
if name.startswith(‘DNS:’):
return x509.DNSName(to_text(name[4:]))
if name.startswith(‘IP:’):
return x509.IPAddress(ipaddress.ip_address(to_text(name[3:])))
if name.startswith(‘email:’):
return x509.RFC822Name(to_text(name[6:]))
if name.startswith(‘URI:’):
return x509.UniformResourceIdentifier(to_text(name[4:]))
except Exception as e:
raise OpenSSLObjectError(‘Cannot parse Subject Alternative Name “{0}”: {1}’.format(name, e))
if ‘:’ not in name:
raise OpenSSLObjectError(‘Cannot parse Subject Alternative Name “{0}” (forgot “DNS:” prefix?)’.format(name))
raise OpenSSLObjectError(‘Cannot parse Subject Alternative Name “{0}” (potentially unsupported by cryptography backend)’.format(name))
The documentation says it should support dirname but indeed it doesn’t. Can we amend the documentation?
Thanks,
Josh Goldman