Created
November 27, 2017 19:03
-
-
Save phaniav/dbf82f93314aaafadb286dcbc129a7d7 to your computer and use it in GitHub Desktop.
Creating the Selfsigned certificate using powershell commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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