title: Making pfx from certificates with openssl giving "No certificates matches private key"
body: <p>I am unable to work out what is going wrong with this;</p>
  <pre><code>$ openssl genrsa -out sign.key 4096
  $ openssl req -x509 -new -nodes -key sign.key -sha256 -days 1825 -out sign.pem
  ...
  $ openssl pkcs12 -export -out sign.pfx -inkey sign.key -in sign.pem
  Enter Export Password:
  Verifying - Enter Export Password:
  $ openssl genrsa -out cert.key 4096
  $ openssl req -new -sha256 -key cert.key -out cert.csr
  $ openssl x509 -in cert.csr -out cert.pem -req -signkey sign.key -days 1001
  $ openssl pkcs12 -export -out cert.pfx -inkey cert.key -in cert.pem
  No certificate matches private key
  $ openssl pkcs12 -export -out cert.pfx -inkey cert.key -in sign.pem -in cert.pem
  No certificate matches private key
  $ openssl pkcs12 -export -out cert.pfx -inkey cert.key -in cert.pem -certfile sign.pem
  No certificate matches private key
  $ cat sign.pem cert.pem &gt; bundle.pem
  $ openssl pkcs12 -export -out cert.pfx -inkey cert.key -in sign.pem -certfile bundle.pem
  No certificate matches private key
  $ cat cert.pem sign.pem &gt; bundle.pem
  $ openssl pkcs12 -export -out cert.pfx -inkey cert.key -in sign.pem -certfile bundle.pem
  No certificate matches private key
  </code></pre>
  <p>I've tried doing this on both windows in git bash and on a linux VM, same result.</p>