Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#281) Prevents Creation Of Unrequired Self-Signed Certificate #283

Merged
merged 3 commits into from
Feb 18, 2025

Conversation

JPRuskin
Copy link
Member

@JPRuskin JPRuskin commented Nov 25, 2024

Description Of Changes

This change ensures the Chocolatey Management Service package gets the appropriate parameter in order to not generate unneeded certificate(s).

Motivation and Context

The Chocolatey-Management-Service package generates a self-signed certificate to use if no thumbprint is specified as a parameter.

Regardless of if a certificate was specified, we were installing it without a thumbprint and then setting the certificate later.

This resulted in an unused self-signed certificate being generated and stored.

Testing

Operating Systems Testing

  • Windows Server 2022 (Local, Automated)
  • Windows Server 2019 (Automated Only)

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?

Related Issue

Fixes #281

@JPRuskin JPRuskin force-pushed the serviceCertificateThumbprint branch from 9f84d14 to 760802b Compare December 13, 2024 10:46
@JPRuskin JPRuskin force-pushed the serviceCertificateThumbprint branch from 760802b to 6b877bd Compare January 8, 2025 18:05
@steviecoaster steviecoaster self-requested a review January 8, 2025 18:09
@JPRuskin JPRuskin force-pushed the serviceCertificateThumbprint branch from 6b877bd to 1cae704 Compare January 9, 2025 15:03
The Chocolatey-Management-Service package generates a self-signed certificate to use if no thumbprint is specified as a parameter.

Regardless of if a certificate was specified, we were installing it without a thumbprint and then setting the certificate later.

This resulted in an unused self-signed certificate being generated and stored.

This change ensures the package gets the appropriate parameter in order to not generate unneeded certificate(s).
Having CertificateThumbprint and Thumbprint treated differently across the scripts is annoying, and can introduce confusion.

This change brings all the scripts into the same $Thumbprint (with an alias for folk who instinctively use CertificateThumbprint), and an argument completer.
Copy link
Member

@ryanrichter94 ryanrichter94 left a comment

Choose a reason for hiding this comment

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

Tested locally and built fine.

@JPRuskin
Copy link
Member Author

JPRuskin commented Feb 14, 2025

I fear I'm going to have to push something just to knock GitHub out of it's "checking" loop. Otherwise, I think this is good to merge.

@JPRuskin JPRuskin force-pushed the serviceCertificateThumbprint branch from b024eed to 3498e10 Compare February 18, 2025 14:21
@ryanrichter94 ryanrichter94 merged commit 7a1e2f7 into main Feb 18, 2025
15 checks passed
@ryanrichter94 ryanrichter94 deleted the serviceCertificateThumbprint branch February 18, 2025 16:57
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.

Quickstart Guide should not create a self-signed certificate if a CertificateThumbprint is passed
3 participants