fix(cli): present client certificates in --gateway-insecure mode#2362
Open
zanetworker wants to merge 1 commit into
Open
fix(cli): present client certificates in --gateway-insecure mode#2362zanetworker wants to merge 1 commit into
zanetworker wants to merge 1 commit into
Conversation
--gateway-insecure (OPENSHELL_GATEWAY_INSECURE=true) disables TLS server certificate verification but was also dropping client certificate presentation via .with_no_client_auth(). This broke mTLS gateways that require client certs. Now build_insecure_rustls_config accepts optional TlsMaterials. Both call sites (build_channel and http_health_check) attempt to load client certs from the gateway's mtls directory and pass them through. If certs are unavailable, falls back to no client auth. Fixes NVIDIA#2354 Signed-off-by: Adel Zaalouk <azaalouk@redhat.com>
zanetworker
requested review from
a team,
derekwaynecarr,
maxamillion and
mrunalp
as code owners
July 20, 2026 09:52
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
--gateway-insecure(OPENSHELL_GATEWAY_INSECURE=true) disables TLS server certificate verification but was also dropping client certificate presentation via.with_no_client_auth(). This broke mTLS gateways that require client certs — semantically, "insecure" should mean "skip server verification" (likecurl -k), not "don't authenticate myself."Related Issue
Fixes #2354
Changes
build_insecure_rustls_configto accept optionalTlsMaterials— when provided, uses.with_client_auth_cert()instead of.with_no_client_auth()build_channelandhttp_health_checkinrun.rs) to attempt loading client certs from the gateway's mtls directory before building the insecure config.with_no_client_auth()when certs are unavailable (no regression for non-mTLS setups)Testing
Verified live against a local mTLS gateway:
mise run pre-commitpassesinsecure_config_without_materials_succeeds,insecure_config_with_materials_succeeds,insecure_config_with_invalid_cert_failsChecklist