Self Signed SSL Certificate Creation


We are required to create SSL certificate for Sitecore 9 Installation which is become mandatory, for this we can go with this simple powershell script which will create a SSL along with placing to the Certificate manager personnel and trusted route path, no need to manually go and copy each certificate to trusted route.

$cert = New-SelfSignedCertificate -certstorelocation cert:\localmachine\my\ -dnsname SX9xconnect.domin.com
$pwd = ConvertTo-SecureString -String ‘Test11‘ -Force -AsPlainText
$path = ‘cert:\localMachine\my\’ + $cert.thumbprint
Export-PfxCertificate -cert $path -FilePath C:\certificates\test.pfx -Password $pwd
$cert.thumbprint

$rootStore = New-Object System.Security.Cryptography.X509Certificates.X509Store -ArgumentList Root, LocalMachine
$rootStore.Open(“MaxAllowed”)
$rootStore.Add($cert)
$rootStore.Close()

Make sure the path, Password, and DNS name are changed to proper required values, Marked as bold

 

Have any Question or Comment?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discussion Topics