liveBook · Manning

Dotnet dev-certs

As explained in .NET in Action, Second Edition

dotnet dev-certs is a .NET CLI command for creating, checking, and trusting development HTTPS certificates.

dotnet dev-certs is a .NET CLI command used to install and trust a development certificate so local HTTPS can protect application traffic. section 9.3

Trust a local development certificate

Run dotnet dev-certs https --trust during development. With app.UseHttpsRedirection() enabled, an HTTP request such as http://localhost:<port>/swagger/index.html receives a 307 temporary redirect to the HTTPS URL. section 9.3

Figure 9.2 The threat model with the HTTP request and response highlighted

Use the threat-model figure to see why unencrypted HTTP traffic requires HTTPS protection. section 9.3

How .NET in Action, Second Edition covers it

How deep it goes
Explains the command and its interaction with HTTPS redirection, but does not detail certificate internals.
Examples
Uses dotnet dev-certs https --trust and a localhost Swagger URL that produces a 307 redirect.
What it assumes
Assumes familiarity with HTTP requests and responses while establishing why HTTPS certificates are needed.
What you can do after
Operate local HTTPS by installing and trusting a development certificate through the .NET CLI.
How it connects
Connects development certificates with HTTPS, ASP.NET Core, HTTP redirection, and HSTS.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of .NET in Action, Second Edition. The section links point to the parts of the book it draws on.