Skip to content

(#312) Fixes Issue with Certificate Incorrectly Being Identified as Self-Signed#314

Open
JPRuskin wants to merge 2 commits intochocolatey:mainfrom
JPRuskin:certNotSelfSignedFix
Open

(#312) Fixes Issue with Certificate Incorrectly Being Identified as Self-Signed#314
JPRuskin wants to merge 2 commits intochocolatey:mainfrom
JPRuskin:certNotSelfSignedFix

Conversation

@JPRuskin
Copy link
Copy Markdown
Member

@JPRuskin JPRuskin commented Apr 2, 2026

Description Of Changes

Modifies the logic when a certificate was found to be in the right place such that it stores a $Certificate variable. Also changes $MyCertificate to $Certificate, to better match other scripts.

Motivation and Context

In the circumstance where the certificate was found in the right place, the script would not set $Certificate (formerly $MyCertificate) and consequently evaluate the (missing) certificate as self-signed.

Testing

  • Spun up environment with a non-self-signed cert that was already in TrustedPeople (formerly My)
  • Check the Register script and ensure that the TrustCertificate parameter defaults to false

Operating Systems Testing

  • Windows 2022

Change Types Made

  • Bug fix (non-breaking change).
  • [ ] Feature / Enhancement (non-breaking change).
  • [ ] Breaking change (fix or feature that could cause existing functionality to change).
  • [ ] Documentation changes.
  • PowerShell code changes.

Change Checklist

  • [ ] Requires a change to the documentation.
  • [ ] Documentation has been updated.
  • [ ] Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • [ ] PowerShell code changes: PowerShell v3 compatibility checked?
  • All items are complete on the Definition of Done.

Related Issue

Fixes #312

Switching variable name in order to match other code style.
In some circumstances, environments were being identified as using a self-signed certificate incorrectly.

I believe this was down to $MyCertificate not being set.

This change should fix those scenarios.
@JPRuskin JPRuskin changed the title Cert not self signed fix (#312) Fixes Issue with Certificate Incorrectly Being Identified as Self-Signed Apr 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

C4bVerification-Win2022AzureEditionCore-self-signed

  4 files   16 suites   15s ⏱️
105 tests 104 ✅  1 💤 0 ❌
134 runs  104 ✅ 30 💤 0 ❌

Results for commit efa47f9.

♻️ This comment has been updated with latest results.

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.

Register-C4bEndpoint sets TrustCertificate on non-selfsigned environment

1 participant