Skip to content

Do not fail on partial trust warning. #9384

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

Merged
merged 4 commits into from
May 19, 2025

Conversation

mitchdenny
Copy link
Member

This PR fixes an issue that was reported where the underlying shell out to dotnet dev-certs to trust a certificate might result in a non-zero exit code where the cert is partially trusted.

In these circumstances we probably want to "let it slide" and continue starting up the apphost because there are lots of corner cases around certificate trust particularly on Linux distros which might result in this issue.

Rather than hard blocking we detect we are in this partial trust situation and just display a warning (mostly to help our own diagnostics if it later doesn't actually work).

We should consider modifying dev-certs to return a different exit code for this partial trust situation.

@Copilot Copilot AI review requested due to automatic review settings May 19, 2025 04:43
@mitchdenny mitchdenny self-assigned this May 19, 2025
@mitchdenny mitchdenny requested review from davidfowl and removed request for Copilot May 19, 2025 04:44
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label May 19, 2025
@mitchdenny mitchdenny added area-cli and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels May 19, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses an issue where the HTTPS developer certificate might be partially trusted, preventing a hard failure on a non-zero exit code from the dotnet dev-certs command. The changes include new tests to verify both the success and failure paths and an update to CertificateService to detect and warn when a partial trust condition is encountered.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/Aspire.Cli.Tests/Certificates/CertificateServiceTests.cs Added tests to cover the partial trust scenario
src/Aspire.Cli/Certificates/CertificateService.cs Modified the certificate service to detect a partial trust message and continue startup with a warning
Comments suppressed due to low confidence (1)

src/Aspire.Cli/Certificates/CertificateService.cs:67

  • Consider reusing the outputLines variable instead of calling ensureCertificateCollector.GetLines() again to avoid potential discrepancies if the collector's state changes.
interactionService.DisplayLines(ensureCertificateCollector.GetLines());

@mitchdenny mitchdenny added this to the 9.4 milestone May 19, 2025
@davidfowl davidfowl merged commit 9619ea7 into main May 19, 2025
499 of 502 checks passed
@davidfowl davidfowl deleted the mitchdenny/warn-on-trust-exit-code-4 branch May 19, 2025 06:57
@github-actions github-actions bot locked and limited conversation to collaborators Jun 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants