Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to assign a SSL Certificate to IIS7 Site from Command Prompt

Can you advise me whether it is possible or not to assign a SSL Certificate to a website in IIS7 using the APPCMD application?

I am familiar with the command to set the HTTPS Binding

appcmd set site /site.name:"A Site" /+bindings.[protocol='https',bindingInformation='*:443:www.mysite.com'] 

and how to obtain current mappings

%windir%\system32\inetsrv\Appcmd 

but can not seem to find any way to map a site to a certificate (say the certificates hash for example)

like image 578
David Christiansen Avatar asked Feb 26 '09 17:02

David Christiansen


People also ask

How do you assign an SSL certificate to a specific website?

Under Install and Manage SSL for your site (HTTPS), click Manage SSL Sites. Scroll down to the Install an SSL Website and click Browse Certificates. Select the certificate that you want to activate and click Use Certificate. This will auto-fill the fields for the certificate.


1 Answers

The answer is to use NETSH. For example

netsh http add sslcert ipport=0.0.0.0:443 certhash='baf9926b466e8565217b5e6287c97973dcd54874' appid='{ab3c58f7-8316-42e3-bc6e-771d4ce4b201}' 
like image 50
David Christiansen Avatar answered Oct 02 '22 13:10

David Christiansen