episerver / Foundation-spa-react

Apache License 2.0
35 stars 16 forks source link

Certs included have wrong password #76

Open ethanschofer opened 7 months ago

ethanschofer commented 7 months ago

The cert included in the repo: \Foundation-spa-react\src\Headless.Cms\App_Data\certificates\my.pfx, has a password set in appsettings.json. This password is incorrect. I can see this in the CertificateOptions class. On line 33-ish, where is tries to create a new X509Certificate2, it throws throws an error that the password for the cert is incorrect. I had to generate my own cert. In the context of making my own site that will eventually be out on the web, this is fine. But in the context of using Foundation-Spa-React to learn how to architect a headless site, then its a problem that I spent some time trying to troubleshoot.

tago-SE commented 2 months ago

openssl genrsa -out private.key 2048 openssl req -new -x509 -key private.key -out cert.x509 -days 365 -nodes openssl pkcs12 -export -out my.pfx -inkey private.key -in cert.x509

Country Name (2 letter code) [AU]: US
State or Province Name (full name) [Some-State]: New York
Locality Name (eg, city) []: New York
Organization Name (eg, company) [Internet Widgits Pty Ltd]: MyCompany
Organizational Unit Name (eg, section) []: IT Department
Common Name (e.g. server FQDN or YOUR name) []: localhost
Email Address []: your-email@example.com

openssl pkcs12 -export -out my-certificate.pfx -inkey my-private-key.key -in my-certificate.crt