The 5th annual nopCommerce conference will take place in India on the 10th-11th of October. Please find more about this event here

How to disable forcing SSL for localhost debug?

Posted: April 08, 2015 at 6:43 PM Quote #143172
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?

Thanks.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: April 10, 2015 at 3:34 PM Quote #143296
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;
This post/answer is useful
2
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: April 10, 2015 at 5:06 PM Quote #143297
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.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: April 10, 2015 at 5:52 PM Quote #143298
Glad it helped.  

Forgetting about cached browser content has caused me more headaches than I can count.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: July 07, 2018 at 10:30 AM Quote #208168
[email protected] wrote:
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;



This worked for me too... finally!!! Thank you
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: December 27, 2018 at 10:57 PM Quote #217536
hemilis wrote:
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;



This worked for me too... finally!!! Thank you

This work for me..thank you
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: February 19, 2019 at 9:10 AM Quote #221144
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/
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: July 05, 2019 at 10:45 AM Quote #242200
In Chrome:
1. Open DevTools
2. Click and hold the reload button (left of url address bar) to see more options.
3. Select "Empty Cache and Hard Reload"

https://developers.google.com/web/updates/2015/05/hard-reload
This post/answer is useful
1
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.