Skip to content

Allow partial chain IdP CA in OIDC refresh - #2800

Open
chala2001 wants to merge 1 commit into
kubernetes-client:masterfrom
chala2001:idp-partial-chain
Open

chala2001 wants to merge 1 commit into
kubernetes-client:masterfrom
chala2001:idp-partial-chain

Conversation

@chala2001

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind bug

What this PR does / why we need it:

When the OIDC IdP CA in the kubeconfig is a leaf or intermediate cert, kubectl accepts it but the Python client fails with "self-signed certificate in certificate chain". On Python 3.12 and older OpenSSL needs a self-signed root unless VERIFY_X509_PARTIAL_CHAIN is set. Python 3.13 sets it by default.

This adds Configuration.ssl_partial_chain (off by default) to the sync client, and _refresh_oidc turns it on when an IdP CA is given. The token request goes through requests, so it gets the same flag with a small adapter.

The generated files get scripts/partial_chain_patch.diff, applied in update-client.sh like the keepalive patch.

Which issue(s) this PR fixes:

Fixes #2415

Special notes for your reviewer:

Tested end to end on 3.12 with a local IdP and a root, intermediate, leaf chain. Leaf or intermediate as the CA failed before and works now. An unrelated CA and a wrong hostname still fail. Also checked on 3.13.

The asyncio client is not changed here.

Does this PR introduce a user-facing change?

OIDC token refresh now accepts an IdP CA that is a leaf or intermediate certificate, like kubectl. Added `ssl_partial_chain` to the sync client `Configuration`.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@kubernetes-prow kubernetes-prow Bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 22, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: chala2001
Once this PR has been reviewed and has the lgtm label, please assign roycaihw for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow
kubernetes-prow Bot requested review from roycaihw and yliaog November 22, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IDP certificate issue

1 participant