KNOX-3356: Allow Cloudera Manager service discovery over cleartext HTTP#1272
Merged
Conversation
Test Results22 tests 22 ✅ 2s ⏱️ Results for commit dfef0ab. |
Contributor
|
Why are there CM deployments without TLS? |
pzampino
approved these changes
Jun 19, 2026
Contributor
Author
This is a really good question! |
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.
KNOX-3356 - Allow Cloudera Manager service discovery over cleartext HTTP
What changes were proposed in this pull request?
When Knox is configured with TLS but the target Cloudera Manager server is not, CM service discovery fails with:
The root cause is in
DiscoveryApiClient.configureSsl(): it unconditionally replaced the OkHttp client'sconnectionSpecswith a single TLS-only spec (ConnectionSpec.MODERN_TLS), regardless of the discovery address scheme. OkHttp matches the request URL's scheme against the allowed connection specs, so anhttp://discovery address with noCLEARTEXTspec is rejected before any request is sent.This PR makes TLS configuration conditional on the discovery address actually being HTTPS:
isSecure()helper that checks whether the configured base path starts withhttps:.configureSsl()now returns early (with a DEBUG log) for cleartext addresses, leaving OkHttp's default connection specs, which includeCLEARTEXT, in place.skippingSslConfigurationForCleartextAddressdiscovery message.Behavior for HTTPS discovery addresses is unchanged.
How was this patch tested?
Automated unit tests in
ClouderaManagerServiceDiscoveryTest:testApiClientInterceptorsWhenKerberosIsDisabledAndPasswordIsNotSetto use anHTTPS discovery address (it previously used an HTTP address while asserting a TLS-only spec,
i.e. it asserted the buggy behavior); it still verifies the configured cipher/protocol are
applied on the HTTPS path.
testApiClientAllowsCleartextForHttpDiscoveryAddress, which uses anhttp://addressand asserts the client retains a
CLEARTEXT-capable connection spec.Both tests pass:
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0.Integration Tests
N/A
UI changes
N/A