web 2.0

SSL Certificate - self-signed

Creates new wildcard self-signed SSL certificate for development purposes. Needs PowerShell admin.

new-selfsignedcertificate -dnsname "*.domain.local" -friendlyname "*.domain.local Development Certificate" -certstorelocation "cert:\LocalMachine\My" -notafter (get-date).AddYears(10)

=========================

Creating root certificate
First we need to create a self signed root certificate which in turn we will use to sign our system certificate.
As this is a root certificate, for the CN I add “RootCA” into the fqdn.

$todaydt = Get-Date
$10years = $todaydt.AddYears(10)
$rootCert = New-SelfSignedCertificate -Subject 'CN=UstyleRootCA,O=USTYLE' -KeyExportPolicy Exportable -KeyUsage CertSign,CRLSign,DigitalSignature -KeyLength 2048 -KeyUsageProperty All -KeyAlgorithm 'RSA' -HashAlgorithm 'SHA256' -Provider 'Microsoft Enhanced RSA and AES Cryptographic Provider' -notafter $10years

Creating system certificate
Once root certificate is generated you can use it to sign your system certificate.
I use below command to generate my system self signed certificate:

$10years = $todaydt.AddYears(10)
$SelfSignCert=New-SelfSignedCertificate -CertStoreLocation cert:\LocalMachine\My -Subject *.bg046.com -DnsName bg046.com, *.bg046.com -notafter $10years -Signer $rootCert -KeyUsage KeyEncipherment,DigitalSignature -HashAlgorithm "SHA256"

We need to export our certificate as file which we will import. Importing certificate to trusted root folder
Once copied to the destination replica server, you need to import these certificates to the “Trusted Root Certification Authorities” folder.

.......

 

 

Comments are closed