title: SelfSignedCertificate not accepted in MS Edge (Win 10)
body: <p>To get Edge to trust the localhost development server, I created a selfsigned certificate following this <a href="https://zeropointdevelopment.com/how-to-get-https-working-in-windows-10-localhost-dev-environment/" rel="nofollow noreferrer">tutorial</a>. I just replaced all instances of client-1.local by localhost.</p>
  <p>So in short, I created a trusted authority by creating a .pem-file with the commands</p>
  <pre><code>openssl genrsa -des3 -out rootSSL.key 2048
  </code></pre>
  <p>and then</p>
  <pre><code>openssl req -x509 -new -nodes -key rootSSL.key -sha256 -days 1024 -out rootSSL.pem
  </code></pre>
  <p>and imported those into the trusted authorities store in the MMC.</p>
  <p>Then I created a private key with</p>
  <pre><code>openssl req -new -sha256 -nodes -out localhost.csr -newkey rsa:2048 -keyout localhost.key -subj &quot;/C=AU/ST=NSW/L=Sydney/O=Client One/OU=Dev/CN=localhost/emailAddress=local@local.com&quot;
  </code></pre>
  <p>and a certificate with</p>
  <pre><code>openssl x509 -req -in localhost.csr -CA rootSSL.pem -CAkey rootSSL.key -CAcreateserial -out localhost.crt -days 50000 -sha256 -extensions &quot;authorityKeyIdentifier=keyid,issuer\n basicConstraints=CA:FALSE\n keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment\n  subjectAltName=DNA:localhost&quot;
  </code></pre>
  <p>The certificate shows up as valid when double clicking on it.</p>
  <p>For the exception I need to import the certificate into the browsers. For Firefox I got at first the error</p>
  <pre><code>You do not own the private key for the certificate
  </code></pre>
  <p>So I created a PKCS12 file</p>
  <pre><code>openssl pkcs12 -export -inkey ./sample.key -in ./sample.crt -out ./sample.p12
  </code></pre>
  <p>and imported that one in Firefox under &quot;My Certificates&quot;. That works, I host with <em>ng serve &quot;ssl/localhost.crt&quot;</em> and Firefox with the imported <em>.p12</em> accepts my localhost. Now for MS Edge it still complains, my certificate is not valid.</p>
  <p>I also tried <em>.pfx</em>-merging, but no change. I also read the certificates should not be installed under My Certificates but as Authorities. That sounds wrong to me but I tried it and imported both the <em>.crt</em> and the <em>.p12</em> into <em>Authorities</em> and <em>Root Authorities</em>, because why not, but no change. I also installed the certificate through the Windows Wizard.</p>
  <p>What am I missing for MS Edge? I sadly have no way around it.</p>
  <p>===== Update =====</p>
  <p>Additional information:</p>
  <p>Edge does not give any helpful error. <a href="https://api.leeway.tech/edge%20error___m6n84jd9.PNG" rel="nofollow noreferrer">Here</a> is an image of the message. It is in German but all it says is the default text &quot;The connection is not secure. The certificate is invalid. Your credit card information might be stolen.&quot; If there is some way to get a more informative message for Edge I would be very happy. In the developer console the message is:</p>
  <blockquote>
  <p>This site does not have a valid SSL certificate! Without SSL, your site's and visitors' data is vulnerable to theft and tampering. Get a valid SSL certificate before  releasing your website to the public.</p>
  </blockquote>
  <p>The certificate files and the output of <code>openssl x509 -text localhost.crt</code> can be viewed <a href="https://filetransfer.io/data-package/SUKk1mxP#link" rel="nofollow noreferrer">here</a> (password is pass or password, if necessary) and an image of the .crt <a href="https://api.leeway.tech/ccert___1aprgqru.PNG" rel="nofollow noreferrer">here</a>. It is sitting in my development folder, I host the site with</p>
  <pre><code>ng serve --ssl true --ssl-cert \&quot;ssl/localhost.crt\&quot; --ssl-key \&quot;ssl/localhost.key\&quot;
  </code></pre>
  <p>and access the server locally through localhost:3000.</p>
  <p>I imported the .p12 file into edge through manage certificates -&gt; My Certificates -&gt; Import. The result looks like <a href="https://api.leeway.tech/edge%20import___1qnokgve.PNG" rel="nofollow noreferrer">this</a>.</p>