Skip to content

Perl installer certificate trust remediation - #2306

Merged
aaronpowell merged 2 commits into
CommunityToolkit:mainfrom
Omnideth:perl-installer-certificate-trust-remediation
Oct 28, 2026
Merged

aaronpowell merged 2 commits into
CommunityToolkit:mainfrom
Omnideth:perl-installer-certificate-trust-remediation

Conversation

@Omnideth

Copy link
Copy Markdown
Contributor

Closes #2305

Replaced the EnvironmentCallbackAnnotation with a certificate trust configuration on the installer
itself:

resource.ApplicationBuilder.CreateResourceBuilder(installerResource)
    .WithCertificateTrustConfiguration(ctx =>
    {
        if (ctx.CertificateBundlePath is { } bundlePath)
        {
            ctx.EnvironmentVariables["SSL_CERT_FILE"] = bundlePath;
            ctx.EnvironmentVariables["PERL_LWP_SSL_CA_FILE"] = bundlePath;
            ctx.EnvironmentVariables["MOJO_CA_FILE"] = bundlePath;
        }
        return Task.CompletedTask;
    });

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • New integration
    • Docs are written
    • Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

Other information

I'm unclear if this should be stacked - and I wasn't clear how to do that cross fork - so I just chained it separately into main.

Could go on top of #2304 or could be reviewed after.

Let me know in comments if there is a better way to stack these - I am willing to do it differently if needed/desired.

Copilot AI balanced review requested due to automatic review settings October 27, 2026 02:08
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.sh | bash -s -- 2306

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.ps1) } 2306"

Copilot AI 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.

🟡 Changes recommended

Installer-name collisions can silently skip a distinct requested Perl module.

1 open issue
What changed in this PR

This PR fixes Perl installer certificate trust for #2305 by using each resource’s Aspire certificate context instead of the AppHost process environment. It also includes the duplicate-package handling related to #2304.

Changes:

  • Shares certificate configuration between Perl apps and their installers.
  • Adds regression tests for certificate propagation, call ordering, and repeated package requests.
  • Documents opt-in certificate trust and installer reuse behavior.
File Description
tests/​CommunityToolkit.Aspire.Hosting.Perl.Tests/​WithPackageTests.cs Tests repeated package requests reuse one installer and completion dependency.
tests/​CommunityToolkit.Aspire.Hosting.Perl.Tests/​WithCertificateTrustTests.cs Tests resource-specific certificate contexts, call ordering, and duplicate guards.
src/​CommunityToolkit.Aspire.Hosting.Perl/​README.md Documents certificate trust and repeated-package behavior.
src/​CommunityToolkit.Aspire.Hosting.Perl/​PerlAppResourceBuilderExtensions.PackageManager.cs Configures installer certificate trust and normalizes names before lookup.
src/​CommunityToolkit.Aspire.Hosting.Perl/​PerlAppResourceBuilderExtensions.cs Extracts the shared certificate configuration callback.

Review effort: Balanced

@aaronpowell aaronpowell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Got a merge conflict here

@Omnideth

Copy link
Copy Markdown
Contributor Author

Will fix tomorrow evening and address the copilot comment as well.

@Omnideth
Omnideth force-pushed the perl-installer-certificate-trust-remediation branch from 8012c26 to 3c83d51 Compare October 27, 2026 05:37
@Omnideth

Copy link
Copy Markdown
Contributor Author

I lied, I ended up time sinking tonight on it: rebased off fresh main (which should address the readme merge conflict) and addressed the suggestion by copilot.

Copilot AI 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.

🟢 Approval recommended

Static review found no blocking issues, and the regression tests cover the changed certificate-trust, installer-reuse, and publish-mode behavior.

No open issues 🎉

1 resolved since last review
1 file not reviewed
  • examples/perl/CpanmApiIntegration.AppHost.TypeScript/package-lock.json: Generated file

Review effort: Balanced

@Omnideth
Omnideth requested a review from aaronpowell October 27, 2026 05:49
@Omnideth Omnideth mentioned this pull request Oct 27, 2026
7 of 10 tasks
@aaronpowell
aaronpowell merged commit be31c0a into CommunityToolkit:main Oct 28, 2026
16 checks passed
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.

Perl - Installer Certificate Trust

3 participants