Add Update-SsrsCertificate.ps1 for SSRS certificate renewal #1
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/ssrs-certificate-update"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What does this PR do?
Adds
Update-SsrsCertificate.ps1, a companion toInstall-SqlServerCertificate.ps1that rebinds SQL Server Reporting Services (SSRS) to a renewed TLS certificate when
SSRS is co-located with the SQL Server instance. It uses the supported Reporting
Services WMI provider (
MSReportServer_ConfigurationSetting), the same mechanismthe Reporting Services Configuration Manager uses, so no
netshis required. Itverifies and, if needed, rewrites the
<CertificateHash>values inrsreportserver.config(backing the file up first), and can restart the SSRSservice.
Key design point: HTTP.SYS allows only one certificate per IP:port, and the report
server's two applications (
ReportServerWebService,ReportServerWebApp) normallyshare
0.0.0.0:443. The script groups bindings by IP:port and removes all of agroup's bindings before recreating them against the renewed certificate. Rebinding
one application at a time collides with its sibling on the shared binding and can
leave a binding removed without a replacement.
Fixes #
How was this tested?
[Parser]::ParseFile()returns no errors)-WhatIfagainst a live SSRS instance: lists current bindings, reports the planned actions, and makes no changes0.0.0.0:443from an initial self-signed certificate to a renewed one, plusrsreportserver.config<CertificateHash>verificationAssumptions
-RestartReportServerpath (aRestart-Servicecall) requires a configuredreport server database so the service can start; it was not exercised in the test
environment above and will be validated on a server that has one during the real
renewal.
LocalMachine\My(for example byInstall-SqlServerCertificate.ps1) and chains to a trusted root, which SSRSrequires before it will bind a certificate.
Checklist
Set-StrictMode -Version Latest-WhatIfviaSupportsShouldProcess