Advanced Installation TopicsSelf-Signed Certificate (PowerShell)

Self-Signed Certificate (PowerShell)

Sana Commerce 9.3
Your connector

Create Root Certificate

Step 1: Run Windows PowerShell as an administrator. Navigate to the folder where the certificate must be created.

Step 2: Execute the following command, replacing the value of the "DnsName" parameter with something relevant to you, for example the name of your company.

New-SelfSignedCertificate -CertStoreLocation "cert:\LocalMachine\My" -DnsName "Sana Commerce" -KeyusageProperty All -KeyUsage CertSign, CRLSign, DigitalSignature

Executing this command will add the self-signed SSL certificate to your local certificate store. You will also see the certificate thumbprint. You will need it to export the certificate.

Step 3: Next you need to populate a variable with a password you'll use when exporting the certificate from the local certificate store. Execute the following command, replacing the value of the "String" parameter with the strong password.

$pwd = ConvertTo-SecureString -String "abcABC123!" -Force -AsPlainText

Step 4: Export the certificate from the local certificate store by executing the command below. Replace the certificate thumbprint and specify the name of the certificate ("*.pfx").

Export-PfxCertificate -Cert cert:\localMachine\my\AFA299CD881192D3F3FDE92BB463180C8540FC8A -FilePath sanaroot.pfx -Password $pwd

Now you can find the certificate ("*.pfx") in the folder specified in the first step.

Step 5: Import the created certificate to the Trusted Root Certification Authorities certificates.

Advanced Installation TopicsSelf-Signed Certificate (PowerShell)