There are times where you need to enable HTTPS during local development. It may be because of some API demanding you to use HTTPS to ensure data is transmitted securely (Flickr is a good example). Or maybe you want your local environment to match production environment a little more (where you should definitely use HTTPS). That’s when you need to use a SSL certificate on your local machine.
For local purposes, we usually do not need the real certificate we are using on our production site. A self-signed certificate should do the job as well. Creation of a self-signed certificate is not difficult as there are multiple ways to do this (see here for example).
Chances are you need to account for Windows users, and therefore for Microsoft web browsers (the Microsoft Edge browser available since Windows 10 and Internet Explorer 11). You might wonder why your self-signed certificate is not working properly in Edge and Internet Explorer while they work perfectly fine on other web browsers like Google Chrome and Mozilla Firefox.
Microsoft Edge and Internet Explorer do not trust self-signed certificates by default for security reasons which is a good thing. Any web browser should do this (and probably all modern browsers available do this) as the risk is that the client is currently talking to a fake server (see this article for a more detailed explanation).
But when you need to trust your self-signed certificate you created because you need it for local development, the process is fairly simple in browsers like Chrome or Firefox. However, trusting them in Edge or Internet Explorer is not so trivial. In this article, I will show you how to get your self-signed SSL certificate working on both Edge and IE11. Keep in mind we are not talking about the new Edge browser which is based on Chromium and therefore more resembles Google Chrome.
Do this process only for certificates you created yourself! And do not set your browser to accept all certificates by default!
How to trust your self-signed certificate in Edge and IE11
To trust your self-signed certificate in Edge and Internet Explorer, you need to perform the following steps in Internet Explorer even if you only need to support the Edge browser as I could not get it to work from inside Edge.
- Browse to your page (e.g. https://localhost:44300) in Internet Explorer which should use your self-signed SSL certificate. You should be greeted by an error message saying your certificate is not trustworthy.
- Click “Continue to this website”.
- Click on “Certificate error” in the address bar, and then click “View certificates”.
- Click “Install Certificate”.
- Click “Place all certificates in the following store”, and then click “Browse”. Do not rely on the preselected option to automatically select the certificate store as this will not work!
- Inside the dialog box, click “Trusted Root Certification Authorities”, and then click “OK”.
- Finish the dialog.
- When you get a security warning, click “Yes” to trust the certificate.
- Reload your page. The certificate should be working fine now.
These should be all the steps to get your self-signed SSL certificate working in both Microsoft Edge and Internet Explorer. The process is slightly more difficult to perform than in other web browsers but still manageable and you only need to do it once for this certificate to make it work in both Edge and Internet Explorer. Do you know any other way to get self-signed certificates working in Internet Explorer or Microsoft Edge? Let me know in the comments.