[docs] Document TypeScript AppHost dev-cert trust for outbound TLS connections - #1493
[docs] Document TypeScript AppHost dev-cert trust for outbound TLS connections#1493aspire-repo-bot[bot] wants to merge 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Frontend HTML artifact readyThe latest frontend build uploaded the This comment updates automatically when a new frontend build artifact is uploaded. |
There was a problem hiding this comment.
Pull request overview
Adds missing documentation to the TypeScript AppHost guide explaining how the Aspire CLI ensures outbound TLS from Node.js trusts the same development certificate used by Aspire orchestration, including how NODE_EXTRA_CA_CERTS is set/combined.
Changes:
- Added a new “Trusting the certificate for outbound TLS connections” subsection under “HTTPS development certificates”.
- Documented the
ASPIRE_HOMEPEM cache behavior andNODE_EXTRA_CA_CERTShandling (including preserving existing values). - Added/retained a cross-reference to Certificate configuration docs.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| ### Trusting the certificate for outbound TLS connections | ||
|
|
||
| When your AppHost code opens TLS connections to Aspire-managed resources at run time (for example, connecting directly to the dashboard's OTLP endpoint from custom AppHost logic), the Aspire CLI ensures Node.js trusts the same development certificate that DCP uses. The CLI exports the trusted development certificate into a content-addressed PEM cache under `ASPIRE_HOME`, and Node.js is configured to trust that bundle through the `NODE_EXTRA_CA_CERTS` environment variable. |
David Pine (IEvangelist)
left a comment
There was a problem hiding this comment.
Automated docs-accuracy review — Phase A (claims) + Phase B (doc-tester)
Phase A source of truth: microsoft/aspire @ release/13.5, SHA 8ab6999850d96e0023670799edbd4bdc245ad63c (matches this PR's base).
Reviewed head SHA: 48751f40cf958e938ce6f4f57659796883cf0c26.
Phase A — claims: 4 non-narrative claims extracted → 4 verified, 0 verified-with-nuance, 0 unverifiable, 0 contradicted.
Phase B — doc-tester: 1 page exercised (/app-host/typescript-apphost/, anchor #trusting-the-certificate-for-outbound-tls-connections) → 0 critical, 0 warnings, 0 knowledge gaps.
Verdict: APPROVE — every factual claim in the new "Trusting the certificate for outbound TLS connections" section matches the CLI's GuestAppHostProject certificate-bundle logic on release/13.5, and the section renders cleanly.
Phase A — Claim verification
No contradicted or unverifiable claims. The feature is present on the targeted release/13.5 branch and the prose matches the implementation precisely.
Verified claims (4) with source evidence
Evidence paths are in microsoft/aspire @ release/13.5 (8ab6999).
- The CLI exports the trusted dev certificate and configures Node.js to trust it —
verified.src/Aspire.Cli/Projects/GuestAppHostProject.cs:608-614— when the guest runtime declares aCertificateBundleEnvironmentVariable, the CLI calls_certificateService.ExportDevCertificatePem(...)thenConfigureCertificateBundleEnvironmentAsync(...).src/Aspire.Cli/Certificates/NativeCertificateToolRunner.cs:199-236selects the trusted ASP.NET Core HTTPS development certificate and exports its public PEM (the shared dev cert). - Exported into a content-addressed PEM cache under
ASPIRE_HOME—verified.src/Aspire.Cli/Certificates/CertificateService.cs:60-61—DevCertDirectory => Path.Combine(executionContext.AspireHomeDirectory.FullName, "dev-certs").NativeCertificateToolRunner.GetOrCreateCertificateCacheFile(...)writesaspire-dev-cert-{hash}.pemwherehash = XxHash128.Hash(pemContents)(content-addressed), viaCertificateCacheWriter.WriteFile(CertificateCacheWriter.cs:52: "Another process published the same content-addressed file first"). - Node.js is configured through the
NODE_EXTRA_CA_CERTSenvironment variable —verified.src/Aspire.Hosting.CodeGeneration.TypeScript/TypeScriptLanguageSupport.cs:60—CertificateBundleEnvironmentVariable => "NODE_EXTRA_CA_CERTS";GuestAppHostProject.cs:2085—SetCertificateBundleEnvironmentVariable(..., environmentVariableName /* NODE_EXTRA_CA_CERTS */, certificateBundlePath). - An existing
NODE_EXTRA_CA_CERTSvalue is preserved via a combined bundle containing both certificates, not overwritten —verified.GuestAppHostProject.csConfigureCertificateBundleEnvironmentAsync(lines ~2037-2085): readsexistingCertificateBundle; if set and different, buildsbundleContents = [.. devCertificateContents, (byte)'\n', .. existingBundleContents](both included, Aspire cert first), writes a content-addressed{cacheFilePrefix}-{bundleHash}.pemunderAspireHomeDirectory/dev-certs/bundles, and on I/O failure falls back to the existing bundle unchanged. Covered bytests/Aspire.Cli.Tests/Projects/GuestAppHostProjectTests.cs.
The illustrative example ("connecting directly to the dashboard's OTLP endpoint from custom AppHost logic") is narrative framing and was not treated as a hard claim.
Phase B — Doc-tester results
Report reproduced verbatim from the doc-tester skill run (blind to source; navigation via Playwright; served locally with pnpm dev).
Documentation Test Report
Focus Area: PR #1493 TypeScript AppHost outbound TLS certificate trust subsection
Date: 2026-08-14
Tester: doc-tester agent
Served Base URL:http://localhost:4321/
Served Head SHA:48751f40cf958e938ce6f4f57659796883cf0c26Routes Exercised:
http://localhost:4321/app-host/typescript-apphost/http://localhost:4321/app-host/typescript-apphost/#trusting-the-certificate-for-outbound-tls-connectionsScreenshots:
pr1493-trusting-certificate-outbound-tls.pngSummary
Category Passed Failed Warnings Content Accuracy 4 0 0 Code Examples 0 0 0 CLI Commands 0 0 0 Links 2 0 0 Critical Issues
None.
Warnings
None.
Passed Checks
- The TypeScript AppHost page loaded successfully.
- The "Trusting the certificate for outbound TLS connections" subsection appears in the "On this page" navigation.
- Clicking the navigation entry resolved to
#trusting-the-certificate-for-outbound-tls-connections.- Both new paragraphs rendered cleanly.
ASPIRE_HOMErendered with inline code formatting.NODE_EXTRA_CA_CERTSrendered with inline code formatting in both paragraphs.- The text clearly explains that Aspire preserves an existing
NODE_EXTRA_CA_CERTSvalue by generating a combined bundle.- The following "Certificate configuration" LearnMore link still rendered.
- The "Certificate configuration" link points to
/app-host/certificate-configuration/with a trailing slash.- No broken anchor, duplicated content, or formatting issue was observed in the tested section.
Recommendations
- Priority fixes: None.
- Documentation gaps: None found in the tested section.
- Product issues: None discovered from blind documentation testing.
Knowledge Gaps
None.
Automated review: Phase A verifies claims against microsoft/aspire source at the release-branch SHA; Phase B validates the rendered docs as a new user via the doc-tester skill.
Documents changes from microsoft/aspire#15634
@danegstaTargeting
release/13.5— the latest release branch onmicrosoft/aspire.dev— becauserelease/13.6(from the source PR milestone13.6) does not exist there.Why this PR is needed
The source PR (
polyglot_code_generator_changedsignal triggered onTypeScriptLanguageSupport.cs) ensures TypeScript AppHosts trust the ASP.NET Core development certificate when custom AppHost code opens TLS connections to Aspire-managed resources in run mode. Specifically it:ASPIRE_HOME.NODE_EXTRA_CA_CERTS).NODE_EXTRA_CA_CERTSvalue by creating a secure, content-addressed combined bundle.This is user-facing behavior for anyone running a TypeScript AppHost that makes outbound HTTPS connections (e.g., to the dashboard's OTLP endpoint), and it wasn't previously documented on the TypeScript AppHost page.
What changed
Added a new subsection, "Trusting the certificate for outbound TLS connections", under the existing "HTTPS development certificates" section of
app-host/typescript-apphost.mdx, explaining:ASPIRE_HOME.NODE_EXTRA_CA_CERTSis used and how existing values are preserved via a combined bundle.Files modified
src/frontend/src/content/docs/app-host/typescript-apphost.mdx(updated)No new pages were created; this extends existing documentation.