dotnet-dev-certs(1)
dotnet-dev-certs π
okay bestie, welcome to the dotnet-dev-certs page, straight out of the .NET Documentation manual β¨ This is the one that makes HTTPS work on your local machine while you're building stuff, and honestly? it's giving essential.
This article applies to: βοΈ .NET 6 SDK and later versions π«Ά
β¨ NAME β¨
dotnet-dev-certs β Generates a self-signed certificate to enable HTTPS use in development. no cap, that's literally its whole job π
πΈ SYNOPSIS πΈ
dotnet dev-certs https
[-c|--check] [--check-trust-machine-readable]
[--clean] [-ep|--export-path <PATH>]
[--format] [-i|--import] [-np|--no-password]
[-p|--password] [-q|--quiet] [-t|--trust]
[-v|--verbose] [--version]
dotnet dev-certs https -h|--help
π¦ DESCRIPTION π¦
The dotnet dev-certs command manages a self-signed certificate to enable HTTPS use in local web app development. Its main functions are:
- Generating a certificate for use with HTTPS endpoints during development. π
- Trusting the generated certificate on the local machine.
- Removing the generated certificate from the local machine.
- Exporting a certificate in various formats so that it can be used by other tools.
- Importing an existing certificate generated by the tool into the local machine.
π Commands
https
dotnet dev-certs has only one command: https. The dotnet dev-certs https command with no options checks if a development certificate is present in the current user's certificate store on the machine. If the command finds a development certificate, it displays a message like the following example:
A valid HTTPS certificate is already present.
If the command doesn't find a development certificate, it creates one in the current user's certificate store, the store named My in the location CurrentUser. The physical location of the certificate is an implementation detail of the .NET runtime that could change at any time. On macOS in .NET 7.0, the certificate is stored in the user key chain and as a PFX file: ~/.aspnet/https-aspnetcore-localhost-<Thumbprint[0..5]>.pfx.
After creating a certificate, the command displays a message like the following example:
The HTTPS developer certificate was generated successfully.
By default, the newly created certificate is not trusted. To trust the certificate, use the --trust option.
To create a file that you can use with other tools, use the --export-path option.
π OPTIONS π
-c,--checkβ Checks for the existence of the development certificate but doesn't perform any action. Use this option with the--trustoption to check if the certificate is not only valid but also trusted. π--check-trust-machine-readableβ Same as running--check --trust, but outputs the results in JSON. machine-readable, bestie π€--cleanβ Removes all HTTPS development certificates from the certificate store by using the .NET certificate store API. Doesn't remove any physical files that were created by using the--export-pathoption. On macOS in .NET 7.0, thedotnet dev-certscommand creates the certificate on a path on disk, and the clean operation removes that certificate file.
If there's at least one certificate in the certificate store, the command displays a message like the following example:
Cleaning HTTPS development certificates
from the machine.
A prompt might get displayed to confirm
the removal of some of the certificates.
HTTPS development certificates
successfully removed from the machine.
-ep,--export-path <PATH>β Exports the certificate to a file so that it can be used by other tools. Specify the full path to the exported certificate file, including the file name. The containing directories must already exist and access to them should be restricted. π The type of certificate files that are created depends on which options are used with--export-path:--export-pathβ The public part of the certificate as a PFX file.--export-path --format PEMβ The public part of the certificate in PEM format. No separate.keyfile is created.--export-path --passwordβ The public and private parts of the certificate as a PFX file.--export-path --password --format PEMβ The public and private parts of the certificate as a pair of files in PEM format. The key file has the.keyextension and is protected by the given password.--export-path --no-password --format PEMβ The public and private parts of the certificate as a pair of files in PEM format. The key file has the.keyextension and is exported in plain text. The--no-passwordoption is intended for internal testing use only.
--formatβ When used with--export-path, specifies the format of the exported certificate file. Valid values arePFXandPEM, case-insensitive.PFXis the default.
The file format is independent of the file name extension. For example, if you specify --format pfx and --export-path ./cert.pem, you'll get a file named cert.pem in PFX format. the way that extension is lying to you π
For information about the effect of this option when used with --password, --no-password, or without either of those options, see --export-path earlier in this article.
-i,--import <PATH>β Imports the provided HTTPS development certificate into the local machine. Requires that you also specify the--cleanoption, which clears out any existing HTTPS developer certificates.
PATH specifies a path to a PFX certificate file. Provide the password with the --password option.
-np,--no-passwordβ Doesn't use a password for the key when exporting a certificate to PEM format files. The key file is exported in plain text. β οΈ This option is not applicable to PFX files and is intended for internal testing use only.-p,--passwordβ Specifies the password to use:- When exporting the development certificate to a PFX or PEM file.
- When importing a PFX file.
When exporting with --format PEM, the public and private parts of the certificate are exported as a pair of files in PEM format. The key file has the .key extension and is protected by the given password. In addition to the file name specified for the --export-path option, the command creates another file in the same directory with the same name but a .key extension. For example, the following command will generate a file named localhost.pem and a file named localhost.key in the /home/user directory:
dotnet dev-certs https --format pem -ep /home/user/localhost.pem -p $CREDENTIAL_PLACEHOLDER$
In the example, $CREDENTIAL_PLACEHOLDER$ represents a password. π don't hardcode it fr fr
-q,--quietβ Display warnings and errors only. shhh π€«-t,--trustβ Trusts the certificate on the local machine.
If this option isn't specified, the certificate is added to the certificate store but not to a trusted list.
When combined with the --check option, validates that the certificate is trusted.
-v,--verboseβ Display debug information. π
π EXAMPLES π
- Check for the presence of a development certificate, and create one in the default certificate store if one doesn't exist yet. But don't trust the certificate.
dotnet dev-certs https
- Remove any development certificates that already exist on the local machine.
dotnet dev-certs https --clean
- Import a PFX file.
dotnet dev-certs https --clean --import ./certificate.pfx -p $CREDENTIAL_PLACEHOLDER$
In the preceding example, $CREDENTIAL_PLACEHOLDER$ represents a password.
- Check if a trusted development certificate is present on the local machine.
dotnet dev-certs https --check --trust
- Create a certificate, trust it, and export it to a PFX file.
dotnet dev-certs https -ep ./certificate.pfx -p $CREDENTIAL_PLACEHOLDER$ --trust
- Create a certificate, trust it, and export it to a PEM file.
dotnet dev-certs https -ep ./certificate.crt --trust --format PEM
- Create a certificate, trust it, and export it to a PEM file including the private key:
dotnet dev-certs https -ep ./certificate.crt -p $CREDENTIAL_PLACEHOLDER$ --trust --format PEM
β SEE ALSO β
- Generate self-signed certificates with the .NET CLI
- Enforce HTTPS in ASP.NET Core
- Troubleshoot certificate problems such as certificate not trusted
- Hosting ASP.NET Core images with Docker over HTTPS
- Hosting ASP.NET Core images with Docker Compose over HTTPS
okay that's the whole page, you ate that π«Ά this was dotnet-dev-certs(1) from the .NET Documentation manual, dated 2025-10-30 β go forth and be trusted, bestie πβ¨π
π¦ where this page comes from
- alpine 3.24: dotnet-doc 10.0.303-r2 Β· MIT
- centos-stream 10: dotnet-host 11.0.0~rc.2.26504.105-0.10.el10 Β· 0BSD AND Apache-2.0 AND (Apache-2.0 WITH LLVM-exception) AND APSL-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND BSL-1.0 AND bzip2-1.0.6 AND CC0-1.0 AND CC-BY-3.0 AND CC-BY-4.0 AND CC-PDDC AND CNRI-Python AND EPL-1.0 AND GPL-2.0-only AND (GPL-2.0-only WITH GCC-exception-2.0) AND GPL-2.0-or-later AND GPL-3.0-only AND ICU AND ISC AND LGPL-2.1-only AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND LicenseRef-ISO-8879 AND MIT AND MIT-Wu AND MS-PL AND MS-RL AND NCSA AND OFL-1.1 AND OpenSSL AND Unicode-DFS-2015 AND Unicode-DFS-2016 AND W3C-19980720 AND X11 AND Zlib
- centos-stream 9: dotnet-host 11.0.0~rc.2.26504.105-0.11.el9 Β· 0BSD AND Apache-2.0 AND (Apache-2.0 WITH LLVM-exception) AND APSL-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND BSL-1.0 AND bzip2-1.0.6 AND CC0-1.0 AND CC-BY-3.0 AND CC-BY-4.0 AND CC-PDDC AND CNRI-Python AND EPL-1.0 AND GPL-2.0-only AND (GPL-2.0-only WITH GCC-exception-2.0) AND GPL-2.0-or-later AND GPL-3.0-only AND ICU AND ISC AND LGPL-2.1-only AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND LicenseRef-ISO-8879 AND MIT AND MIT-Wu AND MS-PL AND MS-RL AND NCSA AND OFL-1.1 AND OpenSSL AND Unicode-DFS-2015 AND Unicode-DFS-2016 AND W3C-19980720 AND X11 AND Zlib
- fedora 43: dotnet-host 10.0.12-1.fc43
- fedora 43: dotnet-host 11.0.0~rc.1.26425.128-0.10.fc43 Β· 0BSD AND Apache-2.0 AND (Apache-2.0 WITH LLVM-exception) AND APSL-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND BSL-1.0 AND bzip2-1.0.6 AND CC0-1.0 AND CC-BY-3.0 AND CC-BY-4.0 AND CC-PDDC AND CNRI-Python AND EPL-1.0 AND GPL-2.0-only AND (GPL-2.0-only WITH GCC-exception-2.0) AND GPL-2.0-or-later AND GPL-3.0-only AND ICU AND ISC AND LGPL-2.1-only AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND LicenseRef-ISO-8879 AND MIT AND MIT-Wu AND MS-PL AND MS-RL AND NCSA AND OFL-1.1 AND OpenSSL AND Unicode-DFS-2015 AND Unicode-DFS-2016 AND W3C-19980720 AND X11 AND Zlib
- fedora 44: dotnet-host 10.0.12-1.fc44
- fedora 44: dotnet-host 10.0.4-1.fc44 Β· 0BSD AND Apache-2.0 AND (Apache-2.0 WITH LLVM-exception) AND APSL-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND BSL-1.0 AND bzip2-1.0.6 AND CC0-1.0 AND CC-BY-3.0 AND CC-BY-4.0 AND CC-PDDC AND CNRI-Python AND EPL-1.0 AND GPL-2.0-only AND (GPL-2.0-only WITH GCC-exception-2.0) AND GPL-2.0-or-later AND GPL-3.0-only AND ICU AND ISC AND LGPL-2.1-only AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND LicenseRef-ISO-8879 AND MIT AND MIT-Wu AND MS-PL AND MS-RL AND NCSA AND OFL-1.1 AND OpenSSL AND Unicode-DFS-2015 AND Unicode-DFS-2016 AND W3C-19980720 AND X11 AND Zlib
- fedora 44: dotnet-host 11.0.0~rc.1.26425.128-0.12.fc44 Β· 0BSD AND Apache-2.0 AND (Apache-2.0 WITH LLVM-exception) AND APSL-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND BSL-1.0 AND bzip2-1.0.6 AND CC0-1.0 AND CC-BY-3.0 AND CC-BY-4.0 AND CC-PDDC AND CNRI-Python AND EPL-1.0 AND GPL-2.0-only AND (GPL-2.0-only WITH GCC-exception-2.0) AND GPL-2.0-or-later AND GPL-3.0-only AND ICU AND ISC AND LGPL-2.1-only AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND LicenseRef-ISO-8879 AND MIT AND MIT-Wu AND MS-PL AND MS-RL AND NCSA AND OFL-1.1 AND OpenSSL AND Unicode-DFS-2015 AND Unicode-DFS-2016 AND W3C-19980720 AND X11 AND Zlib
- nixpkgs unstable: dotnet-vmr 11.0.0-rc.3
- ubuntu noble: dotnet-host-10.0 10.0.12-0ubuntu1~24.04.1
- ubuntu questing: dotnet-host-10.0 10.0.9-0ubuntu1~25.10.1
- ubuntu resolute: dotnet-host-10.0 10.0.12-0ubuntu1~26.04.1
- ubuntu resolute: dotnet-host-10.0 10.0.5-0ubuntu1 Β· MIT
- ubuntu stonking: dotnet-host-10.0 10.0.12-0ubuntu2 Β· MIT
- ubuntu stonking: dotnet-host-11.0 11.0.0~rc1-0ubuntu1 Β· MIT
- ubuntu stonking: dotnet-host-11.0 11.0.0~rc3-0ubuntu1~26.10.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms