ググればいっぱい出てくるけど、Black Jumbo Dog で検証用に HTTPS を手っ取り早く立てたかったため、 powershell で ptx 形式の証明書を作るメモ。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
$cert = New-SelfSignedCertificate ` -Type SSLServerAuthentication ` -Subject "www.naokilog.com" ` -DnsName "naokilog.com" ` -CertStoreLocation "cert:\LocalMachine\My" ` -KeyDescription "Self-signed certificate" ` -KeyExportPolicy Exportable ` -NotAfter (Get-Date).AddYears(1) $MyPwd = ConvertTo-SecureString ` -String "Password123#" ` -Force ` -AsPlainText Export-PfxCertificate ` -Cert $cert ` -Password $MyPwd ` -FilePath "C:\self-signed.pfx" |
パラメータはこのへん
https://docs.microsoft.com/en-us/powershell/module/pkiclient/new-selfsignedcertificate?redirectedfrom=MSDN&view=win10-ps
管理者権限でないとダメみたい。(/・ω・)/