Skip to content

Add a debug command to check Store cert pinning - #6519

Open
JohnMcPMS wants to merge 3 commits into
microsoft:masterfrom
JohnMcPMS:cert-rot
Open

JohnMcPMS wants to merge 3 commits into
microsoft:masterfrom
JohnMcPMS:cert-rot

Conversation

@JohnMcPMS

@JohnMcPMS JohnMcPMS commented Sep 11, 2026

Copy link
Copy Markdown
Member

📖 Description

Adds a debug command (validate-store-pinning) to check the current Store cert pinning against a target URL.

🔍 Validation

Works against the current URL and fails against an arbitrary non-Microsoft URL.

Microsoft Reviewers: Open in CodeFlow

@JohnMcPMS
JohnMcPMS requested a review from a team as a code owner September 11, 2026 18:33

@ranm-msft ranm-msft left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read through this one carefully; it looks correct to me.

The part I spent the most time on was the lifetime aggregation, and I convinced myself it is right: a chain's remaining lifetime is the minimum across its certificates (a chain is only as healthy as its soonest-expiring cert), while the configuration takes the maximum across its chains (one validating chain is sufficient). That is the semantics you want for an early-warning signal, and it is an easy one to get backwards.

I also double-checked that GetRemainingLifetimePercentage returns remaining rather than elapsed lifetime - it does. The comment above the declaration reads ambiguously enough that I went and looked, so it might be worth a word if you are touching that file anyway, but it is pre-existing and not from this PR.

Approving.

Out of curiosity rather than as review feedback: is this meant to stay a manual debug command, or would you eventually want the lifetime check running as a health signal in the shipping client? The aggregation looks useful well outside winget debug.

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.

2 participants