Repository navigation
feat: send cert-key-chain files to icr w/o enforcing encodin - #2540
Merged
Merged
Conversation
Ref:AUTOTOOL-5428
crosbygw
approved these changes
Oct 14, 2026
crosbygw
left a comment
Collaborator
There was a problem hiding this comment.
Summary
The delegated review reported no definite bugs. It called out a caveat:
- The new documentation claim about supporting content with "any character encoding" was broader than what the subagent could verify.
I then reviewed the branch against devel directly and checked the full context of the changed files. The changes are limited to:
- switching deprecated ansible.module_utils._text imports to ansible.module_utils.common.text.converters
- changing SSL cert/key content handling from StringIO to BytesIO
- hashing and upload paths now operating on raw bytes via surrogateescape
That implementation is internally consistent: - the collection declares requires_ansible: '>=2.16.0', so the new import path matches the supported Ansible floor
- upload_file() already has an explicit BytesIO code path in plugins/module_utils/icontrol.py, so the stream type change fits existing helper behavior
- the SHA1 comparison logic now hashes uploaded bytes directly instead of re-encoding chunked text, which is the right direction for preserving non-UTF-8-originated content
Collaborator
Author
|
While it is true that Ansible now accepts any character encoding in cert/key/chain metadata, iControl currently replaces some characters, if they are non-utf-8 chars, which means this documentation is accurate before and after that is fixed. We have tested these 27 encodings:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enable
bigip_ssl_key_cert,bigip_ssl_key, andbigip_ssl_certificatemodules to accept and upload certificate/key content with non-UTF-8 character encodings (Latin-1, CP1252, etc.). Fixes UTF-8 codec errors when uploading certificates with extended metadata while maintaining full backward compatibility with UTF-8 content. Also resolves Ansible 2.24+ deprecation warnings for module imports.Changes
Core Encoding Fix (3 modules)
StringIOwithBytesIOfor raw byte handling_to_bytes()method to ModuleParameters class to convert strings to bytes while preserving surrogate characters usingsurrogateescapeerror handler_get_hash()to use BytesIO without UTF-8 encodingcreate_on_device()andupdate_on_device()to use BytesIO for key/cert contentDeprecation Fixes
ansible.module_utils._texttoansible.module_utils.common.text.convertersansible.module_utils._texttoansible.module_utils.common.text.convertersto_bytesandto_textfrom new locationDocumentation Updates
Testing
Checklist
Ref:AUTOTOOL-5428