1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-06-11 02:25:36 +00:00

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>
This commit is contained in:
Alexei Znamensky 2026-05-31 18:33:35 +12:00
parent a794ccf127
commit 683412e766

View file

@ -279,7 +279,7 @@ def _get_digest_from_x509_file(module, pem_certificate_file, openssl_bin):
def _export_public_cert_from_pkcs12(module, executable, pkcs_file, alias, password, dest):
"""Runs keytools to extract the public cert from a PKCS12 archive and write it to a file."""
export_cmd = [executable, "-list", "-noprompt", "-keystore", pkcs_file, "-storetype", "pkcs12", "-rfc"]
export_cmd = [executable, "-list", "-keystore", pkcs_file, "-storetype", "pkcs12", "-rfc"]
# Append optional alias
if alias:
export_cmd.extend(["-alias", alias])