For some reason, this hasn't ever worked for me on Linux. I've had to use the script in this GitHub repo to make dotnet dev certs work on Ubuntu.
github.com/BorisWilhelms/cre…
Which mostly works awesome. But somehow right now I have an expired dev cert that for the life of me I can't find. Did clean, deleted every localhost cert in certmgr. I'm about to have to reinstall Windows, lol.