Skip to content

Conversation

@danegsta
Copy link
Member

@danegsta danegsta commented Jan 7, 2026

Ensure SSL_CERT_DIR messages are always shown and check for existing value

Improved logging for SSL_CERT_DIR related messages on Unix

Description

Ensures EventLevel.LogAlways messages are shown for the dev-certs tool even when --verbose isn't specified to provide more visibility into setting the SSL_CERT_DIR environment variable on Linux. Checks to see if the environment variable is already set and, if so, provides specialized instructions on how to update. If the environment variable is already set and includes the dev cert trust path, we won't prompt. If it's set, but doesn't include the path, we instruct them to append instead of replace the value of the environment variable.

@github-actions github-actions bot added the area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI label Jan 7, 2026
@danegsta
Copy link
Member Author

danegsta commented Jan 7, 2026

This PR and #64966 are both updating log messages; I'll need to update log IDs after one of the PRs merge.

Copy link
Contributor

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 enhances the dev-certs tool's logging behavior on Unix systems by ensuring SSL_CERT_DIR-related messages are always shown (even without --verbose), and adds intelligent handling of existing SSL_CERT_DIR environment variable values. The changes provide better user guidance by checking whether the certificate directory is already configured, and if not, providing context-specific instructions for setting or appending to the environment variable.

Key Changes:

  • Modified event listener setup to always capture critical events (including LogAlways level) without requiring --verbose flag
  • Added logic to detect and handle existing SSL_CERT_DIR environment variable values
  • Created new log events for different SSL_CERT_DIR configuration scenarios

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/Tools/dotnet-dev-certs/src/Program.cs Modified event listener initialization to ensure non-verbose mode still captures critical/LogAlways events
src/Shared/CertificateGeneration/UnixCertificateManager.cs Added logic to check existing SSL_CERT_DIR value and provide appropriate instructions based on whether the certificate directory is already included
src/Shared/CertificateGeneration/CertificateManager.cs Added new event methods for different SSL_CERT_DIR scenarios and updated existing event message formatting

@danegsta danegsta enabled auto-merge (squash) January 8, 2026 19:34
@danegsta danegsta merged commit 387505c into main Jan 8, 2026
25 checks passed
@danegsta danegsta deleted the danegsta/linuxSslCertDir branch January 8, 2026 21:48
@dotnet-policy-service dotnet-policy-service bot added this to the 11.0-preview1 milestone Jan 8, 2026
@danegsta
Copy link
Member Author

danegsta commented Jan 8, 2026

/backport to release/10.0

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

Started backporting to release/10.0 (link to workflow run)

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

Labels

area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants