Hi, I was running https on localhost IIS for the first time, I was usign http under my localhost and after reading this article:
https://deanhume.com/set-up-iis-7-to-run-a-secure-site-locally-https/
I tried to run https on my IIS and localhost.
But I'm facing this error : your connection is not private.
how can resolve that? Thanks.
From the error which you have mentioned "your connection is not private.", it looks you have not properly enabled https in your Visual studio and IIS
For running https on IIS, follow these steps taken from "https://support.microsoft.com/en-in/help/324069/how-to-set-up-an-https-service-in-iis"
To enable SSL in IIS, you must first obtain a certificate that is used to encrypt and decrypt the information that is transferred over the network. IIS includes its own certificate request tool that you can use to send a certificate request to a certification authority. This tool simplifies the process of obtaining a certificate. If you use Apache, you must obtain the certificate manually.
In both IIS and Apache, you receive a certificate file from the certification authority, which you must configure on the computer. Apache reads the certificate from its source file by using the SSLCACertificateFile directive. However, in IIS, you can configure and manage certificates by using the Directory Security tab of the Web site or folder properties.
You can migrate certificates from Apache to IIS; however, Microsoft recommends that you re-create or obtain a new certificate for IIS.
This procedure assumes that your site has already has a certificate assigned to it.
Note: You need to create SSL certificate if you don't have one.
From the answer's of stackoverflow
start --> (IIS) Manager --> Select Server --> Server Certificates:
If you already have an SSL Certificate, you can export your Certificate and jump to step 2.
If you do not have a certificate, you will need to create one in step 1.
1.) Run the following 4 commands from an elevated Command Prompt:
cd C:\Program Files (x86)\Windows Kits\8.1\bin\x64
makecert -r -n "CN=localhost" -b 01/01/2000 -e 01/01/2099 -eku 1.3.6.1.5.5.7.3.3 -sv localhost.pvk localhost.cer
cert2spc localhost.cer localhost.spc
pvk2pfx -pvk localhost.pvk -spc localhost.spc -pfx localhost.pfx
copy files from:
C:\Program Files (x86)\Windows Kits\8.1\bin\x64\localhost.cer
C:\Program Files (x86)\Windows Kits\8.1\bin\x64\localhost.pfx
C:\Program Files (x86)\Windows Kits\8.1\bin\x64\localhost.pvk
C:\Program Files (x86)\Windows Kits\8.1\bin\x64\localhost.spc
to a folder of your choice
2.) start --> run --> mmc.exe certmgr.msc Trusted Root Certification Authorities --> Right-Click Certificates --> All Tasks --> Import Navigate to your Certificate and import it
3.) start --> (IIS) Manager --> Select Server --> Select Website --> Bindings Add a binding for https and point it to your certificate.
Test by opening Internet Explorer and navigating to your localhost site with https in IE.
Another useful link : https://www.codeproject.com/Tips/722979/Setting-up-IIS-with-HTTPS-Binding
If you are looking to enable https in Visual Studio, check my answer on this question "https://qawithexperts.com/questions/328/how-to-enable-ssl-in-locahost-using-visual-studio-2017"
I think you have missed a step creating SSL certificate and importing it while using IIS
Hi Vikas Thanks for your answar I want enabled SSL in localhost for microsoft visual web developer express 2010 & ASP.NET MVC project, I was follow these steps
But I don't found SSL Anabled I don't know why there is just those fields. Please take a look at picture below thanks.
If you are getting this error on chrome and not related to Visual Studio, you can bypass Certificate error by navigating to chrome://flags and search for this entry:
Allow invalid certificates for resources loaded from localhost
and then enable the above option, once you have done it, restart Chrome browser.
Chrome will bypass SSL Error alert.
Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly