Creating and Installing SSL Certificates
- Last UpdatedFeb 19, 2025
- 2 minute read
This topic describes how to create and install SSL certificates.
Create a Self-Signed SSL Certificate
Note: If you already have an SSL certificate, you can skip this section.
-
Access the machine where the server running.
-
Click on the Windows icon in the taskbar, look for Windows PowerShell, and select Run as Administrator.
-
At the command prompt, type hostname and press Enter to get your hostname.
-
Run the following command to create a self-signed certificate and assign it to a variable $cert. Customise the hostname with your hostname before running the below command. The hostname should not have any typo or space.
$cert = New-SelfsignedCertificate -certstorelocation cert:localmachine\my -dnsname "hostname"
-
Run the command, $cert, to see the created certificate with the Thumbprint and Subject details.
-
Run the following command to create a variable with the desired password.
$secPassword = ConvertTo-securestring -string 'passw0rd!' -Force -AsPlainText
-
Run the following command, to store the certificate details to a variable.
$certPath = "Cert:\localMachine\my\$($cert.Thumbprint)"
-
Run the following command to export the certificate to your desired output path. For example, D:\Certificate\cert.pfx, where D:\Certificate folder must exist.
Export-PfxCertificate -Cert $certPath -Filepath D:\Certificate\cert.pfx -Password $secPassword
The cert.pfx certificate is created in the above mentioned file path (D:\Certificate\cert.pfx). Ensure that you can share the certificate with clients, if required.
This screenshot shows a sample sequence of the commands.

Install an SSL Certificate to Personal Certificates Store (Server)
You must install the SSL certificate to the Personal Certificates store on the machine where the server is running.
Install the PFX into your Personal certificates store
-
Right-click on the cert.pfx file and select Install PFX.
-
Select Local Machine and click Next.
-
Click Next and enter the password that was set while generating the PFX file.
-
Select the Mark this Key as Exportable checkbox, and click Next.
-
Select the Automatically select the certificate store option.
-
Click Next and click Finish.
-
Click OK.
Add to an account
-
Press Windows + R, type mmc and click OK.
-
From the File menu, click Add/Remove Snap-in.
-
Select Certificates, then click Add.
-
Choose Computer Account and click Next.
-
Click Finish.
-
Click OK.
Install an SSL Certificate to Trusted Root Certification Authorities Store (Client)
You must install the SSL certificate to the Trusted Root Certification Authorities store on the machine where client is running.
-
Copy the cert.pfx created on the server machine to the client machine, if they are different.
-
Right-click the cert.pfx file, and select Install PFX.
-
Select Local Machine and click Next.
-
Click Next and type the password that was set while generating the PFX file.
-
Select the Mark this Key as Exportable checkbox, and click Next.
-
Select Place all certificates in the following store and click Browse.
-
Select Trusted Root Certification Authorities and click OK.
-
Click Next and click Finish.
-
Click OK.