Search code examples
asp.netssl.net-7.0

.NET 7 https endpoint configuration error


so i've been trying to get this http endpoint configured for my asp .net project (on macOS) for hours and am getting nowhere. I'm getting the following error upon running dotnet run:

Unhandled exception. System.InvalidOperationException: Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found or is out of date. To generate a developer certificate run 'dotnet dev-certs https'. To trust the certificate (Windows and macOS only) run 'dotnet dev-certs https --trust'.

obviously i've tried this solution, i've also tried deleting all the localhost certificates manually from keychain and running the --verbose and --check commands and everything seems to look good, but still the same error upon running the program.

here's my launchSettings.json:

{
  "$schema": "https://json.schemastore.org/launchsettings.json",
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:25736",
      "sslPort": 44375
    }
  },
  "profiles": {
    "API": {
      "commandName": "Project",
      "dotnetRunMessages": true,
      "launchBrowser": false,
      "launchUrl": "swagger",
      "applicationUrl": "https://localhost:5001;http://localhost:5000",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "launchUrl": "swagger",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}

i'm using the minimal hosting model, and there doesn't seem to be anything else in the project files about http or ssl connections besides the string to connect to my front end. the API isn't running on its own though, let alone when hooked up to the FE.

Any other tips?


Solution

  • Remove any reference to HTTPS and you should be able to start the application as an HTTP-only application.