jjaffery
jjaffery

Reputation: 13

Associate existing SSL certificate to IIS Website

Here's my scenario: * I have a certificate installed on my server (Windows Server 2008 R2, with IIS 7.5) * I create a new HTTPS binding via PowerShell command (New-WebBinding), but I have no way here to associate this to the certificate I have (for which I do have the Thumbprint)

Any ideas on how I can go about making this association. In the attached screenshot, this can be done in the GUI simply by editing the HTTPS binding and selecting it from the drop-down, though haven't seen a good example to do this via PowerShell or Command Line.

enter image description here

Upvotes: 1

Views: 2309

Answers (1)

Martin Brandl
Martin Brandl

Reputation: 59031

Use the Get-WebBinding cmdlet to retrieve the binding of your website and set the certificate using the AddSslCertificate method:

$httpsBinding = Get-WebBinding -Name "YourWebSiteName" -Protocol "https"
$httpsBinding.AddSslCertificate('SSL_HASH_STRING', "my")

Upvotes: 2

Related Questions