You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently only PEM format is supported for community.crypto.x509_certificate_info module, so when we try get info about certificate in DER format then we getting:
"msg": "Unable to load PEM file. See https://cryptography.io/en/latest/faq/#why-can-t-i-import-my-pem-file for more details. MalformedFraming"
I noticed community.crypto.x509_certificate_info module uses cryptography. Current code uses load_pem_x509_certificate method but there is a load_der_x509_certificate method in cryptography to load DER certificates.
It would be better than using openssl x509 -in cert.crt -inform der -text -noout command to get certificate info.
…fo` module (#622)
* Added support for DER format
* Updated description
* Adjusted description
The content of the certificate cannot be in DER format due to an input encoding problem in the Ansible module, but it works fine when reading the certificate from a file
* Update support.py
* Added der_support_enabled flag for DER-format support
* Added changelog fragment for #603
* Fixed typo
* Fixed missing import
* Resolved issues found by static code analysis
* Update plugins/module_utils/crypto/support.py
Committed suggested change
Co-authored-by: Felix Fontein <felix@fontein.de>
* Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
SUMMARY
Currently only PEM format is supported for
community.crypto.x509_certificate_info
module, so when we try get info about certificate in DER format then we getting:I noticed
community.crypto.x509_certificate_info
module usescryptography
. Current code usesload_pem_x509_certificate
method but there is aload_der_x509_certificate
method incryptography
to load DER certificates.It would be better than using
openssl x509 -in cert.crt -inform der -text -noout
command to get certificate info.ISSUE TYPE
COMPONENT NAME
community.crypto.x509_certificate_info
ADDITIONAL INFORMATION
community.crypto/plugins/module_utils/crypto/support.py
Line 207 in e4ebca0
https://cryptography.io/en/latest/x509/reference/#cryptography.x509.load_der_x509_certificate
The text was updated successfully, but these errors were encountered: