title: Use SSL Certificate in ASP.NET Core 2.1 while Developing
body: <p>On an ASP.NET Core 2.1 I application appSettings file I have the following:</p>
  
  <pre><code>"Kestrel": {
    "Certificates": {
      "Default": {
        "Path": "localhost.pfx",
        "Password": "1234"
      }
    }
  }  
  </code></pre>
  
  <p>I created the certificate using the dotnet command:</p>
  
  <pre><code>dotnet dev-certs https -ep "localhost.pfx" -p 1234
  </code></pre>
  
  <p>And I copied the localhost.pfx file to the project root along the appSettings file.</p>
  
  <p>When I run the project on <a href="http://localhost:5000" rel="noreferrer">http://localhost:5000</a> it is redirected to <a href="https://localhost:5001" rel="noreferrer">https://localhost:5001</a>.</p>
  
  <p>However, I receive the browser error saying the connection is not safe and asking me to add an exception.</p>
  
  <p>What am I doing wrong?</p>