Skip to content

Instantly share code, notes, and snippets.

@the-takeo
Created September 9, 2019 01:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save the-takeo/4ecda38d7cba7350c71fd2b716467929 to your computer and use it in GitHub Desktop.
Save the-takeo/4ecda38d7cba7350c71fd2b716467929 to your computer and use it in GitHub Desktop.
ReplaceSSL
REM Powershellで「dir cert:\LocalMachine\My」を実行し、証明書の拇印を取得して下記に設定する。
REM 新しいもの(差し替えるもの)と古いもの(差し替えられるもの)の両方の捺印が必要。
set OldThumbprint="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
set NewThumbprint="YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY"
set pfxFileName="ssl.pfx"
certutil -f -p パスワード -importpfx "WebHosting" "%~dp0%pfxFileName%"
cd %windir%\system32\inetsrv
appcmd renew binding /oldcert:%OldThumbprint% /newcert:%NewThumbprint%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment