Skip to content

Feature/certificate trust defaults - #2539

Merged
aaronpowell merged 6 commits into
CommunityToolkit:mainfrom
Omnideth:feature/certificate-trust-defaults
Nov 19, 2026
Merged

aaronpowell merged 6 commits into
CommunityToolkit:mainfrom
Omnideth:feature/certificate-trust-defaults

Conversation

@Omnideth

Copy link
Copy Markdown
Contributor

Closes #2538

Perl resources now trust the custom certificate authorities and developer certificate configured in Aspire by
default. Previously, trust required the experimental opt-in WithPerlCertificateTrust() helper
(CTASPIREPERL001), which is now an obsolete no-op. This brings the Perl integration to feature parity with
Aspire.Hosting.Python and Aspire.Hosting.Java, which configure certificate trust by default from their
Add* methods.

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

The current WithPerlCertificateTrust() behavior is/was experimental, so the breaking change is that it is obsoleted and it now no-ops with a note to the user. By default, though, all Perl Resources now provide a sane default and options under Aspire's .WithCertificateTrustScope(...) method.

Scope SSL_CERT_FILE / PERL_LWP_SSL_CA_FILE / MOJO_CA_FILE OTEL_EXPORTER_OTLP_CERTIFICATE Log
System (default) Bundle path Bundle path —
Override Bundle path Bundle path —
Append Not set by Perl Bundle path Information: Perl TLS stacks cannot append; only OTLP trust is applied
None Not set (Aspire skips the callbacks) Not set —

Copilot AI balanced review requested due to automatic review settings November 17, 2026 05:55
@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 -- 2539

Or

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

@Omnideth

Copy link
Copy Markdown
Contributor Author

The README Integrations Check is a quirk of upping to net11.0, I believe. Since it's a shared eng script, I won't address it in this PR. My agent tried to suggest just slapping:

#:property TargetFramework=net10.0

At the top of eng/scripts/generate-readme-integrations.md.

I have my doubts 😆

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.

🔵 Needs a closer look

The Perl TLS trust changes need runtime validation because the configuration-only tests do not verify HTTPS trust or confirm that Append mode preserves public-CA access.

No open issues 🎉

What changed in this PR

Makes certificate trust automatic for Perl resources, aligning the integration with Aspire’s Python and Java behavior and addressing #2538.

Changes:

  • Enables System trust by default, with scope-aware Perl TLS and OpenTelemetry certificate configuration.
  • Makes dependency installers inherit the parent’s final trust settings and retains WithPerlCertificateTrust() as an obsolete no-op.
  • Expands regression tests and documents trust scopes, overrides, and publish-mode behavior.
File Description
tests/​CommunityToolkit.Aspire.Hosting.Perl.Tests/​WithCertificateTrustTests.cs Tests defaults, scopes, installer inheritance, telemetry certificates, and compatibility.
tests/​CommunityToolkit.Aspire.Hosting.Perl.Tests/​PublishModeWiringTests.cs Tests publish-mode environment and absence of installers.
tests/​CommunityToolkit.Aspire.Hosting.Perl.Tests/​LoggingTestHelper.cs Separates startup-event publication from log collection.
src/​CommunityToolkit.Aspire.Hosting.Perl/​README.md Documents default trust and migration from the opt-in helper.
src/​CommunityToolkit.Aspire.Hosting.Perl/​PerlOtelEnvironmentVariableMirror.cs Clarifies the shared environment dictionary’s XML documentation.
src/​CommunityToolkit.Aspire.Hosting.Perl/​PerlAppResourceBuilderExtensions.PackageManager.cs Configures installer trust and copies parent settings at startup.
src/​CommunityToolkit.Aspire.Hosting.Perl/​PerlAppResourceBuilderExtensions.cs Enables default trust, handles scopes, and obsoletes the old helper.
src/​CommunityToolkit.Aspire.Hosting.Perl/​api/​CommunityToolkit.Aspire.Hosting.Perl.cs Reflects the helper’s obsolete status in the API baseline.
src/​CommunityToolkit.Aspire.Hosting.Perl/​Annotations/​PerlCertificateTrustAnnotation.cs Removes the unused opt-in marker annotation.

Review effort: Balanced

@Omnideth

Copy link
Copy Markdown
Contributor Author

Am looking into the suggestion about the Perl TLS runtime validation - potentially worth adding a few integration tests that serve as those. Will check the assumptions between Windows / Linux on this since the defaults need special handling on Windows vs Linux and compare to how others are handling them (if it's a thing for their languages).

@aaronpowell

Copy link
Copy Markdown
Member

Do you want to hold off the merge until you look at the runtime validation stuff?

@Omnideth

Copy link
Copy Markdown
Contributor Author

@aaronpowell yeah, I started on lunch break but am having issues with the dev container to test changed locally. I'll fiddle with it tonight when the family goes to bed and hard request review when it's ready.

@aaronpowell
aaronpowell marked this pull request as draft November 18, 2026 22:53
@aaronpowell

Copy link
Copy Markdown
Member

I've just popped it back to draft state so we don't accidentally merge it while you're part way through. Set it back to ready when you're happy with where it's at.

The integration test now serves as the "runtime validation" for the default behaviors for cert trust.
@Omnideth

Copy link
Copy Markdown
Contributor Author

Okay I believe I got it to where it needs to be, after the auto checks run, I'll request review.

Feel free to dig in to the new integration test. Had to update the action.yml on linux because you need to get an HTTPS (or multiple) setup for it. Strawberry Perl on windows ships with it by default. The agent summarizes like this:

image

Why these three clients. The Perl integration sets one certificate environment variable per client: SSL_CERT_FILE for HTTP::Tiny, PERL_LWP_SSL_CA_FILE for LWP and MOJO_CA_FILE for Mojo. The runtime tests check that each of those variables actually changes how its client behaves, so each client has to be installed.

Why only Linux. Strawberry Perl on the Windows runners already ships all of these modules plus Mozilla::CA; I checked that under C:\Strawberry\perl\vendor\lib. A base Ubuntu Perl doesn't promise them.

@Omnideth
Omnideth marked this pull request as ready for review November 19, 2026 00:52
@Omnideth
Omnideth requested a review from aaronpowell November 19, 2026 00:55
@aaronpowell
aaronpowell merged commit c53bd9f into CommunityToolkit:main Nov 19, 2026
178 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 - Feature Parity On Certificate Behavior

3 participants