openssl_certificate: Ensure issuer field is set (#34982)

Ensure the Issuer field of the certificate is set when using the
selfsigned backend.

Fixes: https://github.com/ansible/ansible/issues/34963
This commit is contained in:
Yanis Guenane 2018-01-18 14:35:05 +01:00 committed by John R Barker
commit a2b00e9b52
2 changed files with 7 additions and 0 deletions

View file

@ -6,6 +6,11 @@
shell: 'openssl x509 -noout -modulus -in {{ output_dir }}/cert.pem'
register: cert_modulus
- name: Validate certificate (test - issuer value)
shell: 'openssl x509 -noout -in {{ output_dir}}/cert.pem -text | grep "Issuer" | sed "s/.*: \(.*\)/\1/g"'
register: cert_issuer
- name: Validate certificate (test - certficate version == default == 3)
shell: 'openssl x509 -noout -in {{ output_dir}}/cert.pem -text | grep "Version" | sed "s/.*: \(.*\) .*/\1/g"'
register: cert_version
@ -15,6 +20,7 @@
that:
- cert_modulus.stdout == privatekey_modulus.stdout
- cert_version.stdout == '3'
- cert_issuer.stdout == 'CN=www.example.com'
- name: Validate certificate idempotence
assert: