I've installed SSL on my web server for my published nop site. In production SSL is working exactly as I would expect it to and there are no issues there. I currently have the option to force SSL on all pages turned on.
Now when I attempt to debug my nopCommerce source code on localhost outside of the admin area it tries to force localhost to https and I end up with an "SSL connection error" message. Perhaps somewhat oddly, I don't have any problems viewing admin pages on localhost.
Is there a way to create some kind of exception so I don't have to deal with SSL when debugging my Solution from Visual Studio?
Looks like I was able to fix this by inserting a line of code into the OnAuthorization method in class NopHttpsRequirementAttribute under the if clause testing if the action is a child method.
The code added:
if (filterContext.HttpContext.Request.Url.Host.Contains("localhost")) return;
Thanks. This helped me keep some hair on my head. I had changed my site location in the store from the localhost setting when I first installed it to the live site with the http and https and when I tried to debug in Visual Studio it then kept bring me to the live site. I tried changing the setting back in the administration section and I still couldn't debug (still sending me to the live site and never triggering your code). Then I switched browsers from FireFox to Chrome and it worked. It must be a cookie issue.
Looks like I was able to fix this by inserting a line of code into the OnAuthorization method in class NopHttpsRequirementAttribute under the if clause testing if the action is a child method.
The code added:
if (filterContext.HttpContext.Request.Url.Host.Contains("localhost")) return;
Looks like I was able to fix this by inserting a line of code into the OnAuthorization method in class NopHttpsRequirementAttribute under the if clause testing if the action is a child method.
The code added:
if (filterContext.HttpContext.Request.Url.Host.Contains("localhost")) return;
If you're using visual studio and local IIS then there's an option to enable HTTPS in it - see http://dailydotnettips.com/2014/01/27/enabling-ssl-with-iis-express-in-visual-studio/