SkillAgentSearch skills...

dotnet-devcert-trust

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 / Use

npx skills add Aaronontheweb/dotnet-skills --skill dotnet-devcert-trust

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

93/100

Supported Platforms

Universal

Our assessment of dotnet-devcert-trust

dotnet-devcert-trust scores 93/100 on our quality scale, 128th of 506 Data & Analytics skills we index (top 26%).

Its SKILL.md is 16 KB long, well organised into 53 sections with 18 code examples: a thorough specification that gives an agent plenty to work with.

With 1,183 GitHub stars, it is one of the more widely adopted skills in the catalogue.

Substance
30/30
Structure
20/20
Description
15/15
Adoption
13/20
Freshness
15/15

Maintenance, license and trust

  • The repository was last updated 15 days ago, so dotnet-devcert-trust is actively maintained.
  • It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
  • Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

dotnet-devcert-trust compared with similar skills

All 4 of these similar skills score higher than dotnet-devcert-trust; compare them before choosing.

SkillScoreStarsUpdatedFormat
dotnet-devcert-trust (this skill)by Aaronontheweb931.2k15d agoSKILL.md
algorithmic-artby anthropics100177.9k10d agoSKILL.md
pptxby anthropics100177.9k10d agoSKILL.md
designby nextlevelbuilder100130.2k12d agoSKILL.md
ui-ux-pro-maxby nextlevelbuilder100130.2k12d agoSKILL.md

Frequently asked questions

How do I install dotnet-devcert-trust?
Run npx skills add Aaronontheweb/dotnet-skills --skill dotnet-devcert-trust. The install tabs above show the steps for each supported agent.
Which AI agents does dotnet-devcert-trust work with?
It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
Is dotnet-devcert-trust safe to use?
It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is dotnet-devcert-trust still maintained?
The repository was last updated 15 days ago, so dotnet-devcert-trust is actively maintained.

name: dotnet-devcert-trust description: 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. invocable: false

.NET Dev Certificate Trust on Linux

When to Use This Skill

Use this skill when:

  • Redis TLS connections fail with UntrustedRoot or RemoteCertificateNameMismatch in Aspire
  • dotnet dev-certs https --check --trust returns exit code 7
  • HTTPS localhost connections fail with certificate validation errors
  • After running dotnet dev-certs https --clean and 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:

  1. It does not export the certificate to the system CA directory
  2. It does not run update-ca-certificates to rebuild the CA bundle
  3. It does not add the cert to browser trust stores (NSS/NSSDB)
  4. The --trust flag 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:

System.Security.Authentication.AuthenticationException:
  The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot

How Linux Certificate Trust Works

Understanding the architecture prevents cargo-cult debugging:

┌─────────────────────────────────────────────────────┐
│ Application (.NET, curl, OpenSSL)                   │
│   reads: /etc/ssl/certs/ca-certificates.crt         │
│          (consolidated CA bundle)                    │
└──────────────────────┬──────────────────────────────┘
                       │ built by
┌──────────────────────▼──────────────────────────────┐
│ update-ca-certificates                              │
│   reads from:                                        │
│     /usr/share/ca-certificates/      (distro CAs)   │
│     /usr/local/share/ca-certificates/ (local CAs)   │
│   writes to:                                         │
│     /etc/ssl/certs/ca-certificates.crt (bundle)     │
│     /etc/ssl/certs/*.pem (individual symlinks)      │
└─────────────────────────────────────────────────────┘

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

dotnet dev-certs https --check
echo "Exit code: $?"

| 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

ls -la /usr/local/share/ca-certificates/ | grep -iE 'dotnet|aspnet'

| 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:

# Remove ALL stale cert files
sudo rm -f /usr/local/share/ca-certificates/aspnetcore-dev.crt
sudo rm -rf /usr/local/share/ca-certificates/aspnet/

# Ensure correct permissions on the dev cert (if it exists)
sudo chmod 644 /usr/local/share/ca-certificates/dotnet-dev-cert.crt

Check 3: CA Bundle Inclusion

This is the most commonly failed check. The cert file exists but was never added to the bundle.

openssl verify -CAfile /etc/ssl/certs/ca-certificates.crt \
  /usr/local/share/ca-certificates/dotnet-dev-cert.crt

| 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:

sudo update-ca-certificates
# Expected output includes "1 added" or similar

# Re-verify
openssl verify -CAfile /etc/ssl/certs/ca-certificates.crt \
  /usr/local/share/ca-certificates/dotnet-dev-cert.crt

Check 4: Environment Variable Overrides

SSL environment variables can redirect certificate lookups away from the system bundle:

echo "SSL_CERT_DIR=${SSL_CERT_DIR:-<unset>}"
echo "SSL_CERT_FILE=${SSL_CERT_FILE:-<unset>}"
echo "DOTNET_SSL_CERT_DIR=${DOTNET_SSL_CERT_DIR:-<unset>}"
echo "DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=${DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER:-<unset>}"

| 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:

find /etc/ssl/certs/ -xtype l 2>/dev/null | head -5

| Result | Meaning | |--------|---------| | No output | PASS | | Broken symlinks listed | FAIL |

Fix:

sudo update-ca-certificates --fresh
# Rebuilds ALL symlinks from scratch

Full Recovery Procedure

When multiple checks fail or you want a clean slate, run this complete sequence:

#!/usr/bin/env bash
set -euo pipefail

echo "=== .NET Dev Certificate Trust Recovery ==="

# Step 1: Remove ALL stale certificate files
echo "--- Removing stale certificate files ---"
sudo rm -f /usr/local/share/ca-certificates/aspnetcore-dev.crt
sudo rm -rf /usr/local/share/ca-certificates/aspnet/
sudo rm -f /usr/local/share/ca-certificates/dotnet-dev-cert.crt

# Step 2: Clean and regenerate dev cert
echo "--- Regenerating dev certificate ---"
dotnet dev-certs https --clean
dotnet dev-certs https

# Step 3: Export as PEM and install to system trust store
echo "--- Installing to system trust store ---"
dotnet dev-certs https --export-path /tmp/dotnet-dev-cert.crt --format PEM --no-password
sudo cp /tmp/dotnet-dev-cert.crt /usr/local/share/ca-certificates/dotnet-dev-cert.crt
sudo chmod 644 /usr/local/share/ca-certificates/dotnet-dev-cert.crt
rm /tmp/dotnet-dev-cert.crt

# Step 4: Rebuild CA bundle (CRITICAL — most commonly missed step)
echo "--- Rebuilding CA bundle ---"
sudo update-ca-certificates

# Step 5: Verify
echo "--- Verifying ---"
openssl verify -CAfile /etc/ssl/certs/ca-certificates.crt \
  /usr/local/share/ca-certificates/dotnet-dev-cert.crt

echo "=== Done! Restart your .NET application. ==="

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 .crt extension required

Fedora / RHEL / CentOS

Fedora uses update-ca-trust instead of update-ca-certificates:

# Export cert
dotnet dev-certs https --export-path /tmp/dotnet-dev-cert.pem --format PEM --no-password

# Install to Fedora trust store (different directory!)
sudo cp /tmp/dotnet-dev-cert.pem /etc/pki/ca-trust/source/anchors/dotnet-dev-cert.pem
sudo chmod 644 /etc/pki/ca-trust/source/anchors/dotnet-dev-cert.pem
rm /tmp/dotnet-dev-cert.pem

# Rebuild trust bundle
sudo update-ca-trust

# Verify
openssl verify /etc/pki/ca-trust/source/anchors/dotnet-dev-cert.pem

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:

sudo cp /tmp/dotnet-dev-cert.pem /etc/ca-certificates/trust-source/anchors/dotnet-dev-cert.pem
sudo chmod 644 /etc/ca-certificates/trust-source/anchors/dotnet-dev-cert.pem
sudo update-ca-trust

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:

  1. 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.
  2. systemd not running — some older WSL2 setups don't have systemd, which update-ca-certificates hooks may depend on. If the command hangs, try sudo dpkg-reconfigure ca-certificates instead.
  3. 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:

UntrustedRoot

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:

  1. dotnet dev-certs https --check will report no valid cert
  2. Run the full recovery procedure to generate a new cert
  3. The old cert file in /usr/local/share/ca-certificates/ will be replaced
  4. update-ca-certificates will 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

- name: Trust .NET Dev Certificate
  run: |
    dotnet dev-certs https
    dotnet dev-cer

Truncated for display — read the full file on GitHub.

Related Skills

View on GitHub
GitHub Stars1.2k
CategoryData
Updated15d ago
Forks109

Languages

Shell

Trust signals

100/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

No cautions