Skip to content

Instantly share code, notes, and snippets.

@Jaykul
Jaykul / New-RootSignedCert.ps1
Created February 3, 2017 00:20
Generate a self-signed root certificate, and then an SSL cert signed by that root
#.Synopsis
# Generate a self-signed root certificate and then generate an SSL certificate signed by it.
#.Description
# Generates a self-signed root certificate and an SSL certificate signed by it.
# Puts the root public key in a .pem file for adding to PHP's CAcert.pem
param(
# Used as the CN for the Root certificate
$RootName = "NO LIABILITY ACCEPTED - Test Root $(get-date -f "yyyy-MM-dd")",
# Used as the CN for the SSL certificate
$Subject = "${Env:ComputerName}.${Env:UserDnsDomain}",