mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-07-08 11:39:02 +00:00
java_cert: fix PKCS12 password not passed to keytool -list (#12151)
* fix(java_cert): remove -noprompt from keytool -list to allow stdin password -noprompt is not a valid option for keytool -list (only for importkeystore/ importcert). On Java 8, passing it caused keytool to skip reading the store password from stdin, resulting in a null password and NullPointerException. Fixes #3023 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test(java_cert): add idempotency test for pkcs12 import with password Exercises _export_public_cert_from_pkcs12 when the alias already exists, verifying the password is correctly read from stdin on the comparison path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * changelog: add fragment for PR 12151 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f677c2ab7d
commit
994b756026
3 changed files with 22 additions and 1 deletions
|
|
@ -32,6 +32,23 @@
|
|||
that:
|
||||
- result_success is successful
|
||||
|
||||
- name: import pkcs12 again to verify idempotency (tests password via stdin in _export_public_cert_from_pkcs12)
|
||||
community.general.java_cert:
|
||||
pkcs12_path: "{{ remote_tmp_dir }}/{{ test_pkcs12_path }}"
|
||||
pkcs12_password: changeit
|
||||
pkcs12_alias: default
|
||||
cert_alias: default
|
||||
keystore_path: "{{ remote_tmp_dir }}/{{ test_keystore_path }}"
|
||||
keystore_pass: changeme_keystore
|
||||
keystore_create: true
|
||||
state: present
|
||||
register: result_idempotent
|
||||
|
||||
- name: verify idempotency
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result_idempotent is not changed
|
||||
|
||||
- name: import pkcs12 without alias params
|
||||
community.general.java_cert:
|
||||
pkcs12_path: "{{ remote_tmp_dir }}/{{ test_pkcs12_path }}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue