title: Certificate error running a dockerized ASP.NET 5 Web app through https in Visual Studio 2019
body: <p>I have an existing ASP.NET 5 application. I can start it normally in Visual Studio 2019 with F5. The app has https enabled.
  I add docker support to the app, using the Visual Studio tooling &quot;Add Docker Support&quot;. The docker file is created normally, the image is built and the container successfully started by Visual Studio. However, then I hit F5 (with the Docker profile), I get the following exception:</p>
  <blockquote>
  <p>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'. For more information on
  configuring HTTPS see <a href="https://go.microsoft.com/fwlink/?linkid=848054" rel="nofollow noreferrer">https://go.microsoft.com/fwlink/?linkid=848054</a>.</p>
  </blockquote>
  <p>The app continues to work normally if started with IIS Express or Kestrel.
  Using the suggested <em>dotnet dev-certs</em> commands doesn't solve.</p>
  <p>Moreover:</p>
  <ol>
  <li>If I disable https in launchSettings.json</li>
  </ol>
  <pre><code>    &quot;Docker&quot;: {
        &quot;commandName&quot;: &quot;Docker&quot;,
        &quot;launchBrowser&quot;: true,
        &quot;launchUrl&quot;: &quot;{Scheme}://{ServiceHost}:{ServicePort}&quot;,
        &quot;publishAllPorts&quot;: true,
        &quot;useSSL&quot;: false &lt;-
      }
  </code></pre>
  <p>then no problems (http obviously)</p>
  <ol start="2">
  <li>If I create a brand new ASP.NET 5 Web App with HTTPS and Docker support in the same machine, F5 with Docker runs fine straight away (with https).</li>
  </ol>
  <p><strong>Can anyone suggest what the problem could be or how to troubleshoot it?</strong></p>