0

Visual Studio 2019 and Jetbrains Rider .NET Core (and possibly other) projects register a "localhost" root certificate on the system, and then when launching and debugging .NET Core applications, they run the web service using certs and keys that validate against that localhost root cert.

I have my own root cert and want to run under a custom domain, lan.company.com, which also has it's own custom cert and key. How do I configure the project or IDE to use a particular cert and key when serving the app?

1 Answer 1

1

The simplest and clearest solution is to add the following to the project's appsettings.json:

"Kestrel": {
  "Endpoints": {
    "HttpsFromPem": {
      "Url": "https://lan.company.com:5001",
      "Certificate": {
        "Path": "./certs/lan.company.com.crt",
        "KeyPath": "./certs/lan.company.com.key"
      }
    }
  }
}

Then revise the launchSettings.json applicationUrl: "applicationUrl": "https://lan.company.com:5001"

This all assumes that you already have a trusted root certificate and the custom domain cert and key.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.