Redesign SSRS certificate rebind around netsh and application-id scoping #2
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/ssrs-netsh-rebind-redesign"
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?
Redesigns
Update-SsrsCertificate.ps1to rebind SSRS to a renewed certificatethrough
netsh httpscoped by the SSRS application id, replacing the previousReporting Services WMI provider (
Create/RemoveSSLCertificateBinding)approach.
Motivation, from renewing certificates on real multi-name SSRS deployments:
0.0.0.0:443binding. A real deploymentalso has several
hostname:443SNI bindings that live only in HTTP.SYS andshare the SSRS application id. The provider left those stranded on the old
certificate.
RemoveSSLCertificateBindingsrewritesrsreportserver.configin a way thatcan strand the site, and it did so even when the call threw.
New approach:
application id (matched by IP:port, not by hash, so it survives a desync).
the renewed thumbprint is rebound with
netsh http update sslcert(falling backto
delete+add), covering both the IP and the hostname/SNI bindings whileignoring unrelated bindings.
rsreportserver.configis resolved from theRsConfigFilePathregistry valuefirst and validated before any binding is touched; its
<CertificateHash>values are updated (with a backup) for restart-safety.
config file actually changed.
Documentation (
README.md,AGENT-README.md) updated to match.Fixes #
How was this tested?
[Parser]::ParseFile()returns no errors)-WhatIf- read-only discovery only, no changes madebindings: fresh rebind (old cert -> renewed), re-rebind,
-RestartReportServer,and idempotent no-op re-runs, verified in a browser after an SSRS restart.
Checklist
Set-StrictMode -Version Latest-WhatIfviaSupportsShouldProcess