Skip to content

Instantly share code, notes, and snippets.

@sdurandeu
Last active July 4, 2017 23:39
Show Gist options
  • Select an option

  • Save sdurandeu/5377235fb8a1e6552add to your computer and use it in GitHub Desktop.

Select an option

Save sdurandeu/5377235fb8a1e6552add to your computer and use it in GitHub Desktop.
Create self-signed certificates for Azure
// for azure web sites
makecert -r -pe -b 01/01/2013 -e 01/01/2014 -eku 1.3.6.1.5.5.7.3.1 -ss My -n CN=serverdnsname -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 -len 2048
// This will install it in current user
// Then export the PFX from MMC (do not run pvktopfx!)
// for remote desktop for cloud services (powershell)
$cert = New-SelfSignedCertificate -DnsName mysite.cloudapp.net -CertStoreLocation "cert:\LocalMachine\My"
$password = ConvertTo-SecureString -String "your-password" -Force -AsPlainText
Export-PfxCertificate -Cert $cert -FilePath ".\tryazurecdnworker-westus-dev.pfx" -Password $password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment