As security becomes more critical to web based applications the need to test and develop locally with SSL is good practice. Outside of spending mountains of money generating local test environment official SSL Certificates, we can create what is called a ‘Self-Signed’ Certificate.
There are plenty of articles out there that walk through steps to creating a self-signed certificate, some more detailed than others. This post aims to serve two purposes. First, to provide me a future (easy to find) reference point. Secondly, provide helpful information to the fewest number of steps required for creating a self-signed certificate.
Sitecore Fundamentals Install
As a Sitecore developer first (and most of my current teams are Sitecore related) the usage of the Sitecore Fundamentals Install framework will already be on their machine. For those not into Sitecore development, the following additional quick steps will need to be ran.
Setup PowerShell to interact with the Sitecore MyGet feed
- Open a PowerShell command prompt, ensure you are running it as Admin
- Register the connection to MyGet feed, at the prompt enter
Register-PSRepository -Name SitecoreGallery -SourceLocation https://sitecore.myget.org/f/sc-powershell/api/v2
- Install the Sitecore Fundamentals module, at the prompt enter
Install-Module SitecoreFundamentals
- PowerShell will ask if untrusted scripts can be ran, enter ‘A‘ and hit Enter.
- Before performing any other steps, and each time before you use the module, you will want to perform a check and update of the module via
Update-Module SitecoreFundamentals
- Confirming everything installed correctly is as easy as running the following command, at time of writing the current version is 1.1.0
Get-Module SitecoreFundamentals -ListAvailable
Setup SSL
- Ensure your site exists in IIS
- Open a PowerShell command prompt, ensure you are running it as Admin
- Run the following at the prompt
Import-Module SitecoreFundamentals
- Run the following at the prompt, this will create the self-signed certificate and assign it to your site
Add-WebFeatureSSL -HostName "ENTER THE HOSTNAME FOR SITE" -RootDnsName "DO_NOT_TRUST_TheCodeAttic"
- Enjoy developing securely!!!