Skip to content

Instantly share code, notes, and snippets.

@phaniav
Created November 27, 2017 19:03
Show Gist options
  • Save phaniav/dbf82f93314aaafadb286dcbc129a7d7 to your computer and use it in GitHub Desktop.
Save phaniav/dbf82f93314aaafadb286dcbc129a7d7 to your computer and use it in GitHub Desktop.
Creating the Selfsigned certificate using powershell commands
# https://stackoverflow.com/a/2292546/5532726 - Learn about .cer, .pvk and .pfx
$thumbprint = (New-SelfSignedCertificate `
-Subject "CN=$env:COMPUTERNAME @ Sitecore, Inc." `
-Type SSLServerAuthentication `
-FriendlyName "$env:USERNAME Certificate").Thumbprint
#you can select the path for your pfx export as per your requirements
$certificateFilePath = "C:\Sitecore9\install\$thumbprint.pfx"
Export-PfxCertificate `
-cert cert:\LocalMachine\MY\$thumbprint `
-FilePath "$certificateFilePath" `
-Password (Read-Host -Prompt "Enter password that would protect the certificate" -AsSecureString)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment