🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
LocalhostDevCert
This page was created by Hans.karlsen on 2020-12-16. Last edited by Wikiadmin on 2026-07-29.

You can trust an HTTPS development certificate for localhost when running local MDrivenServer Core or MDriven Turnkey Core over HTTPS without browser certificate warnings.

Choose HTTP or HTTPS

For local development, decide whether you need HTTPS before configuring a certificate.

Situation What to do
You are running local MDrivenServer Core or MDriven Turnkey Core builds after 2021-04-05 and do not need HTTPS locally. Run the server with -nohttps. This avoids local certificate setup. See LocalServers.
You need to access your local server through HTTPS and want the browser to trust https://localhost:<port>. Install and trust the .NET developer HTTPS certificate, as described on this page.

HTTPS protects traffic between two parties. That protection is important on the internet, but it adds certificate and trust requirements that can complicate a local-only environment. When both server and browser run locally, HTTP is often sufficient for development.

Run a local server without HTTPS

For local Core server builds after 2021-04-05, add -nohttps to the command line.

For example:

AppCompleteGenericCore.exe -host=10.186.18.39 -port=5019 -nohttps

Or, when using a host name:

AppCompleteGenericCore.exe -host=jumpdev_hk.yourdomain.com -port=5019 -nohttps

Use this option on both the Turnkey and MDrivenServer .NET Core versions when you want to run without HTTPS. If you access either server from another machine, you may also need a Windows Firewall inbound rule for the port you selected. For local server setup and configuration, see Documentation:LocalServers.

Trust the localhost developer certificate

Use this procedure when your local HTTPS endpoint must be trusted by the browser.

A developer certificate is a certificate trusted on your development machine for local HTTPS use. You need the .NET Core SDK installed because the dotnet dev-certs command is provided by the SDK.

  1. Install the .NET Core SDK. The original LocalServers setup uses the .NET Core 3.1 SDK.
  2. Open a Command Prompt window.
  3. Run the following command:
dotnet dev-certs https --trust
  1. Accept the trust prompt if Windows displays one.
  2. Restart the local server and open its HTTPS URL again. For example, if the server uses port 5019, test https://localhost:5019.

Reset a certificate that is not working

If the browser still reports a certificate warning, remove the existing HTTPS developer certificates and create and trust a new one.

  1. Close local server processes that use HTTPS.
  2. Open a Command Prompt window.
  3. Run:
dotnet dev-certs https --clean
dotnet dev-certs https --trust
  1. Restart the local server and test the HTTPS URL again.

Troubleshoot certificate warnings

A certificate must match the URL used by the browser and by MDrivenServer for its own in-process calls. A certificate trusted for localhost does not resolve a mismatch caused by using a different host name.

Check the following:

See also