aaronontheweb/dotnet-skills/dotnet-devcert-trust
- community
Checking that the SKILL.md file is still in the repository.
Diagnose and fix .NET HTTPS dev certificate trust issues on Linux. Covers the full certificate lifecycle from generation to system CA bundle inclusion, with distro-specific guidance for Ubuntu, Fedora, Arch, and WSL2.
Install
npx vskill@latest install aaronontheweb/dotnet-skills/dotnet-devcert-trustSKILL.md
.NET Dev Certificate Trust on Linux
When to Use This Skill
Use this skill when:
- Redis TLS connections fail with
UntrustedRootorRemoteCertificateNameMismatchin Aspire dotnet dev-certs https --check --trustreturns exit code 7- HTTPS localhost connections fail with certificate validation errors
- After running
dotnet dev-certs https --cleanand needing to restore trust - Setting up a new Linux dev machine for .NET HTTPS development
- Aspire dashboard or inter-service gRPC calls fail with TLS errors
- Upgrading from Aspire < 13.1.0 (which didn't use TLS on Redis by default)
The Problem
On Windows and macOS, dotnet dev-certs https --trust handles everything automatically — it generates the certificate, installs it in the user store, and adds it to the system trust store. On Linux, it does almost nothing useful. The command generates the cert and places it in the user store, but:
- It does not export the certificate to the system CA directory
- It does not run
update-ca-certificatesto rebuild the CA bundle - It does not add the cert to browser trust stores (NSS/NSSDB)
- The
--trustflag silently succeeds but the cert remains untrusted
This means .NET applications, OpenSSL, curl, and browsers all reject the dev certificate — even though dotnet dev-certs https --check reports it exists.
Why This Surfaces with Aspire 13.1.0+
Prior to Aspire 13.1.0, Redis connections used plaintext. Starting with 13.1.0, Aspire enables TLS on Redis by default. If your dev cert isn't trusted at the system level, Redis connections fail immediately with:
How Linux Certificate Trust Works
Understanding the architecture prevents cargo-cult debugging:
Key insight: Placing a .crt file in /usr/local/share/ca-certificates/ is necessary but not sufficient. The consolidated bundle at /etc/ssl/certs/ca-certificates.crt must be rebuilt by running update-ca-certificates. Applications read the bundle, not the individual files.
5-Point Diagnostic Procedure
Run these checks in order. Stop at the first FAIL and apply its fix before continuing.
Check 1: Dev Cert Existence
| Exit Code | Meaning | Action | |
|---|---|---|---|
| 0 | Cert exists in user store | PASS — continue | |
| Non-zero | No valid dev cert | Run dotnet dev-certs https |
Check 2: System Trust Store — Single Cert, Correct Permissions
| Result | Meaning | |
|---|---|---|
Only dotnet-dev-cert.crt with -rw-r--r-- (644) | PASS | |
Multiple cert files, wrong permissions, or stale aspnet* files | FAIL |
Common stale files from previous sessions:
| File | Problem | |
|---|---|---|
aspnetcore-dev.crt | Often created with 0600 permissions (unreadable by update-ca-certificates) | |
aspnet/https.crt | Old convention, may have a different fingerprint than current dev cert | |
dotnet-dev-cert.crt with 0600 | Correct name but wrong permissions |
Fix:
Check 3: CA Bundle Inclusion
This is the most commonly failed check. The cert file exists but was never added to the bundle.
| Result | Meaning | |
|---|---|---|
dotnet-dev-cert.crt: OK | PASS — cert is in the consolidated bundle | |
error 20 at 0 depth lookup: unable to get local issuer certificate | FAIL — bundle was never rebuilt | |
error 2 at 0 depth lookup: unable to get issuer certificate | FAIL — same issue, different OpenSSL version |
Fix:
Check 4: Environment Variable Overrides
SSL environment variables can redirect certificate lookups away from the system bundle:
| Result | Meaning | |
|---|---|---|
All <unset> | PASS | |
| Any variable set | FAIL — may redirect cert lookups |
Fix: Remove the offending variables from your shell profile (~/.bashrc, ~/.zshrc, ~/.profile) and start a new shell.
Check 5: Symlink Integrity
Stale symlinks from previously removed certificates can confuse OpenSSL:
| Result | Meaning | |
|---|---|---|
| No output | PASS | |
| Broken symlinks listed | FAIL |
Fix:
Full Recovery Procedure
When multiple checks fail or you want a clean slate, run this complete sequence:
Save this as ~/fix-devcert.sh and run with bash ~/fix-devcert.sh when needed.
Distro-Specific Notes
Ubuntu / Debian
The procedure above is written for Ubuntu/Debian and works as-is.
- CA directory:
/usr/local/share/ca-certificates/ - Bundle command:
sudo update-ca-certificates - Bundle output:
/etc/ssl/certs/ca-certificates.crt - Cert format: PEM with
.crtextension required
Fedora / RHEL / CentOS
Fedora uses update-ca-trust instead of update-ca-certificates:
Key differences:
| Ubuntu/Debian | Fedora/RHEL | ||
|---|---|---|---|
| CA directory | /usr/local/share/ca-certificates/ | /etc/pki/ca-trust/source/anchors/ | |
| Rebuild command | update-ca-certificates | update-ca-trust | |
| Bundle path | /etc/ssl/certs/ca-certificates.crt | /etc/pki/tls/certs/ca-bundle.crt | |
| Extension | .crt | .pem (any extension works) |
Arch Linux
Arch uses the same update-ca-trust approach as Fedora:
WSL2
WSL2 runs a real Linux kernel with its own certificate store — separate from the Windows host. The standard Ubuntu/Debian procedure works, but watch for:
- Shared filesystem (`/mnt/c/`) — cert files on the Windows filesystem have Windows permissions that may not be 644. Always copy to a native Linux path first.
- systemd not running — some older WSL2 setups don't have systemd, which
update-ca-certificateshooks may depend on. If the command hangs, trysudo dpkg-reconfigure ca-certificatesinstead. - Docker Desktop integration — If using Docker Desktop's WSL2 backend, containers inherit the WSL2 distro's CA bundle. Fixing trust in WSL2 fixes it for containers too.
Aspire-Specific Considerations
Redis TLS (Aspire 13.1.0+)
Aspire 13.1.0 enables TLS on Redis by default. If you see:
in Redis connection errors, the dev cert isn't trusted at the system level. Run the full recovery procedure above.
Aspire Dashboard HTTPS
The Aspire dashboard uses the dev cert for HTTPS. If the dashboard shows certificate warnings in the browser, the cert isn't in the browser's trust store. For development, clicking through the warning is acceptable — the system-level trust (needed for Redis, gRPC, etc.) is the priority.
ASPIRE_ALLOW_UNSECURED_TRANSPORT
Setting ASPIRE_ALLOW_UNSECURED_TRANSPORT=true is a workaround, not a fix. It disables TLS for inter-service communication, which:
- Masks the underlying trust issue
- Doesn't match production behavior
- May cause different bugs than what you'd see in production
Fix the cert trust instead.
Certificate Lifecycle
The dev cert is valid for 1 year from creation. When it expires:
dotnet dev-certs https --checkwill report no valid cert- Run the full recovery procedure to generate a new cert
- The old cert file in
/usr/local/share/ca-certificates/will be replaced update-ca-certificateswill swap the old cert for the new one in the bundle
No system reboot is required. Applications pick up the new bundle on next TLS handshake (restart your app).
Automation: CI/CD Pipelines
In CI/CD on Linux runners, dev certs are rarely needed (you typically test against real certificates or disable TLS validation in test harnesses). However, if your integration tests require trusted dev certs:
GitHub Actions
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/dotnet-devcert-trust/SKILL.md
Popularity
- Repository stars
- 1,088
- Repository forks
- 100
- 7-day trend score
- 35
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 22 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/aaronontheweb/dotnet-skills/dotnet-devcert-trust)