Skip to content

MWI: Fix certificate parsing in tbot identity facade's Expiry()#57063

Merged
timothyb89 merged 1 commit intomasterfrom
timothyb89/mwi-facade-expiry-format
Jul 23, 2025
Merged

MWI: Fix certificate parsing in tbot identity facade's Expiry()#57063
timothyb89 merged 1 commit intomasterfrom
timothyb89/mwi-facade-expiry-format

Conversation

@timothyb89
Copy link
Copy Markdown
Contributor

The Expiry() function was trying to parse DER-encoded data in the tls.Certificate as PEM, causing a silent failure. This method was evidently not used until #56927 but failed every time as it was trying to parse certificates using the wrong encoding type.

Backport note: I'll manually cherry pick this into #57060 and #57062

The `Expiry()` function was trying to parse DER-encoded data in the
`tls.Certificate` as PEM, causing a silent failure. This method was
not used until #56927 but failed every time as it was trying to parse
certificates using the wrong encoding type.
@timothyb89 timothyb89 added this pull request to the merge queue Jul 23, 2025
Merged via the queue into master with commit 03b5b4d Jul 23, 2025
44 checks passed
@timothyb89 timothyb89 deleted the timothyb89/mwi-facade-expiry-format branch July 23, 2025 20:52
timothyb89 added a commit that referenced this pull request Jul 23, 2025
The `Expiry()` function was trying to parse DER-encoded data in the
`tls.Certificate` as PEM, causing a silent failure. This method was
not used until #56927 but failed every time as it was trying to parse
certificates using the wrong encoding type.
timothyb89 added a commit that referenced this pull request Jul 23, 2025
The `Expiry()` function was trying to parse DER-encoded data in the
`tls.Certificate` as PEM, causing a silent failure. This method was
not used until #56927 but failed every time as it was trying to parse
certificates using the wrong encoding type.
github-merge-queue bot pushed a commit that referenced this pull request Jul 23, 2025
…57060)

* MWI: Fall back to registering without an existing auth client

This tweaks joining logic to allow clients that provided an existing
auth client (i.e. bots, used to verify bot instance IDs between cert
refreshes) to fall back to not using that auth client if said client
appears to be broken.

It attempts to perform a ping, and if the ping fails, proceeds as if
no existing client was provided.

* Explicitly check for an expired identity during renewal

This adds an explicit check for an expired identity during renewal.
If expired, the existing auth client will not be used.

* Revert changes to the join client

* Linter appeasement

* Tweak warning message on expired identity renewal

* Add note about future improvements and tweak logged warning

* MWI: Fix identity facade's `Expiry()` certificate parsing (#57063)

The `Expiry()` function was trying to parse DER-encoded data in the
`tls.Certificate` as PEM, causing a silent failure. This method was
not used until #56927 but failed every time as it was trying to parse
certificates using the wrong encoding type.
github-merge-queue bot pushed a commit that referenced this pull request Jul 28, 2025
…57062)

* MWI: Fall back to registering without an existing auth client

This tweaks joining logic to allow clients that provided an existing
auth client (i.e. bots, used to verify bot instance IDs between cert
refreshes) to fall back to not using that auth client if said client
appears to be broken.

It attempts to perform a ping, and if the ping fails, proceeds as if
no existing client was provided.

* Explicitly check for an expired identity during renewal

This adds an explicit check for an expired identity during renewal.
If expired, the existing auth client will not be used.

* Revert changes to the join client

* Linter appeasement

* Tweak warning message on expired identity renewal

* Add note about future improvements and tweak logged warning

* MWI: Fix identity facade's `Expiry()` certificate parsing (#57063)

The `Expiry()` function was trying to parse DER-encoded data in the
`tls.Certificate` as PEM, causing a silent failure. This method was
not used until #56927 but failed every time as it was trying to parse
certificates using the wrong encoding type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

machine-id no-changelog Indicates that a PR does not require a changelog entry size/sm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants