Create Root Certificate

Secure Sockets Layer (SSL) is a cryptographic protocol that provides security and data integrity for data communications over a network. By encrypting your web store and ERP Web service with SSL, you make your data and your network more secure and more reliable.

This guide covers creating your own Root Certificate, exporting the PFX certificate, and creating the certificate signed by your root certificate authority using Windows PowerShell. For more information, see New-SelfSignedCertificate.

A self-signed SSL certificate can be used to test your web store, but it shouldn't be used on the production environment. On the production environment, you must use a real SSL certificate to secure your web store. You can also use the self-signed SSL certificate to secure your ERP connection.

For more information, see Data Security.

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.

Copy
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.

Copy
$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).

Copy
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.