Skip to content

Commit 63a8954

Browse files
imcarolwangmconnew
authored andcommitted
Update script to grant IIS pool permissions for the refreshed cert's private key.
1 parent 7bc83d6 commit 63a8954

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/System.Private.ServiceModel/tools/scripts/RefreshServerCertificates.cmd

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ if NOT "%ERRORLEVEL%"=="0" (
4747
goto end
4848
)
4949

50+
:: Grant IIS WCF Service Pool permission to access the new certs' private key
51+
set PoolNames=WcfService1 WcfService2 WcfService3 WcfService4 WcfService5 WcfService6 DefaultAppPool
52+
53+
for %%P in (%PoolNames%) do (
54+
echo [%~n0] powershell -NoProfile -ExecutionPolicy unrestricted %_SCRIPTSDIR%\CertificatePrivateKeyPermissions.ps1 'IIS APPPOOL\%%P' >> %_LOGFILE%
55+
powershell -NoProfile -ExecutionPolicy unrestricted %_SCRIPTSDIR%\CertificatePrivateKeyPermissions.ps1 'IIS APPPOOL\%%P' >> %_LOGFILE% 2>&1
56+
)
57+
5058
:: Configure HTTPS ports to use new certificate
5159
echo [%~n0] powershell -NoProfile -ExecutionPolicy unrestricted %_SCRIPTSDIR%\ConfigHttpsPort.ps1 >> %_LOGFILE%
5260
powershell -NoProfile -ExecutionPolicy unrestricted %_SCRIPTSDIR%\ConfigHttpsPort.ps1 >> %_LOGFILE% 2>&1

src/System.Private.ServiceModel/tools/scripts/ScheduledRestartWcfSelfHostedService.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ if not "%ERRORLEVEL%"=="0" (
3737
echo [%~n0] Kill SelfHostedWCFService.exe so that we can clean up the bin directory >> %_LOGFILE%
3838
TASKKILL /F /IM SelfHostedWCFService.exe >> %_LOGFILE% 2>&1
3939

40+
echo [%~n0] Kill dotnet.exe processes that might remain after running the certificate refresh script >> %_LOGFILE%
41+
TASKKILL /F /IM dotnet.exe >> %_LOGFILE% 2>&1
42+
4043
:: Pull the latest code from GitHub
4144

4245
pushd %_GITREPO%

0 commit comments

Comments
 (0)