How to add https/ssl support to Sitecore 9.1 local instance?

I noticed that accidentally that by default CM application uses http not https – at least when we use installation scripts for on-premise XP0 topology.

Because I wanted to add https to my website I asked myself – “how can I do that EASILY?” I do not know how about you – but I hate to play with certificates on my local machine – very often it means many lost hours which I could spend on development of new features.

To achieve that I checked how Sitecore create and install certificates inside their scripts and I found the following task:

 Invoke-AddWebFeatureSSLTask

It took me few minutes to find final list of attributes which should be set to add certificate acceptable by services like identity server or xconnect. Final version is here:

Invoke-AddWebFeatureSSLTask -Hostname sc910.sc -SiteName sc910.sc -Port 443 -ClientCertLocation LocalMachine -OutputDirectory "C:\certificates" -RootDnsName "DO_NOT_TRUST_SitecoreRootCert" -RootCertName "root-authority"

HostName and SiteName should be values used by your website (check it in IIS configuration if you are not sure). Output directory is a place where you store your certificates. The rest of the parameters I would leave unchanged because they use default values from Sitecore’s installation scripts.

As a result of this task you should see:

  • new certificate file
  • new certificate registered in IIS
  • new binding added to your website

Because Identity Server uses http by default – please remember to update its configuration. If you do not do that – you will not be able to log in into Sitecore instance.
More details about that you will find here.

Subscribe
Notify of
guest
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
trackback

[…] HTTPS on XP0 installs. Thanks to Łukasz Skowroński for the blog […]