Closed walshg3 closed 2 years ago
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
cc @eryx12o45 @jtyr click here for bot help
upon further diagnosis I am starting to see this is working as intended. The LDAPSearch module will solely return search results but it is on me to convert the format. I see in older code I load the certificates into crypto.FILETYPE_ASN1 and that is doing the converting. I will have to do more research in how i can convert a ASN1 returned format to a more readable format in ansible. You can consider this issue closed
@walshg3 were you able to produce the result from ldap_search in human readble format other than this 3IAM1\r0\u000b\u0006\u0003U\u0004\u000b\u0013\u0004deve1\
Please note that there is a new base64_attributes
module option (since c.g 7.0.0) which allows you to specify which attributes should be Base64 encoded (https://docs.ansible.com/ansible/latest/collections/community/general/ldap_search_module.html#parameter-base64_attributes).
Summary
Thank you for taking the time to read the issue I am experiencing. I have used the ansible ldap_search module on occasion and it works without issues however in this rare case I am experiencing odd behavior and I can not seem to figure out why. When I run a ldap_search on my directory I get back the normal values I would expect. My goal is to query and save certificates stored in the directory. Specifically with the attrs 'userCertificate;binary'. When I query the directory for the userCertificates I get results but they are either encoded weird or corrupt. See below for some of the output (I removed any sensitive data but tried to keep the format in tact by replacing data with 'removed.for.client.security')
I have confirmed from the ldapsearch command in the linux shell that the userCertificate is returned with no issues. I also have python modules that I work with the userCertificates without issues as well. Sometimes I need to convert the certificate from der to cer or pem format but I can't identify the format of the output from the ldap_search ansible module. I have tried to convert to base64, utf-8, and Hex but none seem to match the original certificate that is on the directory server.
Any help or Guidance is appreciated. Thank you again.
Issue Type
Bug Report
Component Name
ldap_search
Ansible Version
Community.general Version
Configuration
OS / Environment
RHEL 8
Steps to Reproduce
Expected Results
output to be in PEM or DER format like whats on the Directory Server
Actual Results
Code of Conduct