Repository navigation
respect CLI's SSLDisabled setting in import_from_cf_cli - #332
Open
vkrastanov wants to merge 1 commit into
Open
vkrastanov wants to merge 1 commit into
vkrastanov wants to merge 1 commit into
Conversation
Fix import_from_cf_cli to persist the source CLI's TLS setting instead of hardcoding verify=False
What
import_from_cf_cli() (main/main.py) writes verify=False unconditionally into ~/.cf_client_python.json, ignoring the source CF CLI's SSLDisabled setting.
Why
- Incorrect behavior: a CF CLI with TLS validation enabled (SSLDisabled: false) ends up with a python client that has validation disabled — the import silently inverts the user's actual configuration.
- Inconsistent with the rest of the codebase: the interactive first-run path (build_client_from_configuration) already persists the user's real choice (verify=(verify == "true")); only the import path hardcodes a constant. The default for CloudFoundryClient itself is verify=True.
- Silent and persistent: the value is written once and re-read verbatim by every subsequent command, with no prompt or warning, so the mismatch outlives the original session where it would be noticed.
Change
One line at the write site:
verify=not bool(cf_cli_data.get("SSLDisabled", False))
- SSLDisabled: false (normal) → verify: true
- SSLDisabled: true (cf login --skip-ssl-validation) → verify: false, honoring the user's choice
- key absent → true (fail-safe default)
Author
|
Hi @antechrestos, can you please review the change? |
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.
Fix import_from_cf_cli to persist the source CLI's TLS setting instead of hardcoding verify=False What
import_from_cf_cli() (main/main.py) writes verify=False unconditionally into ~/.cf_client_python.json, ignoring the source CF CLI's SSLDisabled setting. Why
verify=not bool(cf_cli_data.get("SSLDisabled", False))