Skip to content

fix: identify ECDSA algorithm for client keys from exec kubeconfig (#8022) - #8026

Open
arimu1 wants to merge 1 commit into
fabric8io:mainfrom
arimu1:fix/8022-ecdsa-exec-key-algorithm
Open

fix: identify ECDSA algorithm for client keys from exec kubeconfig (#8022)#8026
arimu1 wants to merge 1 commit into
fabric8io:mainfrom
arimu1:fix/8022-ecdsa-exec-key-algorithm

Conversation

@arimu1

@arimu1 arimu1 commented Aug 5, 2026

Copy link
Copy Markdown

Description

Fixes #8022

When a kubeconfig exec credential plugin returns client certificate and key data, the client was not setting clientKeyAlgo. Static client-key-data / client-key entries already run getKeyAlgorithm (fixed in #3535), but the exec path only copied cert/key data.

As a result, ECDSA keys from exec plugins left the algorithm unset, CertUtils.loadKey defaulted to RSA, and loading failed with:

java.io.IOException: Invalid DER: object is not integer

This change calls config.setClientKeyAlgo(getKeyAlgorithm(null, config.getClientKeyData())) after applying exec-provided key material, matching the static kubeconfig path.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change
  • Chore (non-breaking change which doesn't affect codebase;
    test, version modification, documentation, etc.)

Checklist

  • Code contributed by me aligns with current project license: Apache 2.0
  • I Added CHANGELOG entry regarding this change
  • I have implemented unit tests to cover my changes
  • I have added/updated the javadocs and other documentation accordingly
  • No new bugs, code smells, etc. in SonarCloud report
  • I tested my code in Kubernetes
  • I tested my code in OpenShift

Test plan

  • Unit: ConfigTest#autoConfigure_whenExecReturnsEcdsaClientKey_thenSetClientKeyAlgoToEc (exec helper returns SEC1 ECDSA PEM; asserts clientKeyAlgo == "EC")
  • Full ConfigTest (44 tests, 2 Windows-only skipped on macOS) — Temurin 21

…abric8io#8022)

When a kubeconfig exec credential plugin returns client certificate/key
data, set clientKeyAlgo via getKeyAlgorithm (same as static client-key
entries). Without this, ECDSA keys left the algorithm unset and
CertUtils defaulted to RSA, failing key load.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ECDSA client key data algorithm not identified when returned from exec config in kubeconfig

1 participant