Skip to content

[docs] Document explicit Kestrel certificate configuration preservation - #1669

Draft
aspire-repo-bot[bot] wants to merge 1 commit into
release/13.6from
docs/pr-20133-35003411013-1-d5b580c986c54cf9
Draft

aspire-repo-bot[bot] wants to merge 1 commit into
release/13.6from
docs/pr-20133-35003411013-1-d5b580c986c54cf9

Conversation

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Documents changes from microsoft/aspire#20133

@karolz-ms

Targeting release/13.6 based on the source PR milestone 13.6.

Why this is needed

microsoft/aspire#20133 fixes a bug where WithProjectDefaults() would overwrite an explicitly configured Kestrel certificate for .NET project resources with TLS-enabled endpoints. When a resource already used an explicit PEM certificate/key pair (or a certificate store Subject) via WithHttpsCertificateConfiguration, Aspire's default PFX mapping replaced Kestrel__Certificates__Default__Path while leaving KeyPath in place, producing a mixed PFX/PEM configuration that Kestrel rejected with "The provided key file is missing or invalid."

The fix preserves the entire existing certificate configuration (untouched) whenever Kestrel__Certificates__Default__Path, Kestrel__Certificates__Default__KeyPath, or Kestrel__Certificates__Default__Subject is already present (matched case-insensitively), and only falls back to the default PFX mapping when none of those keys exist.

What changed

Added a note to src/frontend/src/content/docs/app-host/certificate-configuration.mdx, in the "Customize certificate configuration" section, explaining:

  • WithProjectDefaults maps the available HTTPS certificate to Kestrel's default PFX environment variables for .NET project resources with TLS-enabled endpoints.
  • This mapping is skipped, and the existing certificate configuration (including password) is preserved, if an earlier callback already set Kestrel__Certificates__Default__Path, Kestrel__Certificates__Default__KeyPath, or Kestrel__Certificates__Default__Subject.
  • Why this matters: it prevents Aspire from mixing an explicit PEM cert/key pair with a replaced PFX path, which Kestrel can't load.

Files modified

  • src/frontend/src/content/docs/app-host/certificate-configuration.mdx (updated existing page — added an <Aside type="note"> in the "Customize certificate configuration" section)

Generated by PR Documentation Check for #20133 · auto · 85.5 AIC · ⌖ 9.4 AIC · ⊞ 18.5K ·

Adds a note to the certificate-configuration doc explaining that
WithProjectDefaults preserves an existing explicit Kestrel certificate
selection (Path, KeyPath, or Subject) instead of overwriting it with
the default PFX mapping, per microsoft/aspire#20133.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@aspire-repo-bot aspire-repo-bot Bot added the docs-from-code Copilot initiated issue from dotnet/aspire repo label Sep 15, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor Author

Frontend HTML artifact ready

The latest frontend build uploaded the frontend-dist artifact for PR #1669. Use the VS Code button below to open this PR with GitHub Artifacts Explorer and browse the built HTML locally.

VS Code: Open PR #1669 artifacts

This comment updates automatically when a new frontend build artifact is uploaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-from-code Copilot initiated issue from dotnet/aspire repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants