Skip to content

Fix incorrect protocol selection when use_tls is provided as string in VaultHook - #62641

Merged
potiuk merged 1 commit into
apache:mainfrom
SameerMesiah97:VaultHook-TLS-Fix
Mar 10, 2026
Merged

Fix incorrect protocol selection when use_tls is provided as string in VaultHook#62641
potiuk merged 1 commit into
apache:mainfrom
SameerMesiah97:VaultHook-TLS-Fix

Conversation

@SameerMesiah97

Copy link
Copy Markdown
Contributor

Description

Fix incorrect handling of the use_tls connection extra in VaultHook. Previously, protocol selection used bool(use_tls), causing string values like "false" to be treated as truthy and incorrectly select HTTPS. This could lead to SSL handshake failures when connections were provisioned with string-based extras.

The fix preserves native boolean values and applies to_boolean() only when needed, ensuring correct handling of both boolean and string representations.

Rationale

The Vault connection documentation defines use_tls as an extra JSON parameter (please refer to this link.) Since connections may be provisioned via environment variables, Helm, Terraform, or other systems that serialize values as strings, the hook must defensively interpret string booleans. This change ensures consistent protocol resolution regardless of how the connection is configured.

Tests

Extended the existing test_protocol_via_use_tls parametrized test to include "true" and "false" string inputs.

Backwards Compatibility

No behavior changes for valid boolean inputs i.e True or False. The fix only corrects handling of string-based use_tls values.

Ensure use_tls extras provided as strings (e.g. "false") are correctly interpreted instead of being treated as truthy, preventing incorrect HTTPS selection and SSL errors. Existing tests were updated to cover string inputs in addition to boolean values.
@boring-cyborg boring-cyborg Bot added area:providers provider:hashicorp Hashicorp provider related issues labels Feb 28, 2026
@eladkal
eladkal requested a review from jason810496 March 2, 2026 17:29
@SameerMesiah97

Copy link
Copy Markdown
Contributor Author

Requesting review for this.

@potiuk
potiuk merged commit a6eae2a into apache:main Mar 10, 2026
86 checks passed
dominikhei pushed a commit to dominikhei/airflow that referenced this pull request Mar 11, 2026
Ensure use_tls extras provided as strings (e.g. "false") are correctly interpreted instead of being treated as truthy, preventing incorrect HTTPS selection and SSL errors. Existing tests were updated to cover string inputs in addition to boolean values.

Co-authored-by: Sameer Mesiah <smesiah971@gmail.com>
Pyasma pushed a commit to Pyasma/airflow that referenced this pull request Mar 13, 2026
Ensure use_tls extras provided as strings (e.g. "false") are correctly interpreted instead of being treated as truthy, preventing incorrect HTTPS selection and SSL errors. Existing tests were updated to cover string inputs in addition to boolean values.

Co-authored-by: Sameer Mesiah <smesiah971@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:hashicorp Hashicorp provider related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants