diff --git a/changelogs/fragments/1005-openssl-4.yml b/changelogs/fragments/1005-openssl-4.yml new file mode 100644 index 00000000..347e4a06 --- /dev/null +++ b/changelogs/fragments/1005-openssl-4.yml @@ -0,0 +1,2 @@ +bugfixes: + - "acme_* modules - adjust OpenSSL RSA private key output parsing to OpenSSL 4.0.0 (https://github.com/ansible-collections/community.crypto/pull/1005)." diff --git a/plugins/module_utils/acme/backend_openssl_cli.py b/plugins/module_utils/acme/backend_openssl_cli.py index ae9238e5..6ec6b831 100644 --- a/plugins/module_utils/acme/backend_openssl_cli.py +++ b/plugins/module_utils/acme/backend_openssl_cli.py @@ -164,7 +164,7 @@ class OpenSSLCLIBackend(CryptoBackend): if account_key_type == "rsa": pub_hex = re.search( - r"modulus:\n\s+00:([a-f0-9\:\s]+?)\npublicExponent", + r"modulus:\n\s+(?:00:)?([a-f0-9\:\s]+?)\npublicExponent", out_text, re.MULTILINE | re.DOTALL, ).group(1)