Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using "RequireHttpsAttribute" on a global level in Asp.net 4.5 in Azure #1730

Closed
BiranchiParida opened this issue Aug 30, 2016 · 4 comments
Closed

Comments

@BiranchiParida
Copy link

I want to declare in code that I want to require the use of HTTPS.

In the past, I used this in Global.asax.cs:

GlobalFilters.Filters.Add(new RequireHttpsAttribute());
it is working in local but in Azure Productions server it is not working

@guardrex
Copy link
Contributor

guardrex commented Sep 4, 2016

Using IIS: #895
Middleware Examples (and MVC filter approach): dotnet/AspNetCore.Docs#135 & https://github.com/Sharpiro/ASP5_Template/blob/master/src/ASP5.Template.Security/Middleware/ForceSsl.cs
Regarding Azure (but this one was fixed in 1.0): aspnet/IISIntegration#140 (comment)
Additional discussion: aspnet/BasicMiddleware#31

The most exciting approach by @ZestyBread is Rewrite Middleware (releasing in 1.1). Link and video at dotnet/AspNetCore.Docs#1839 with discussion in aspnet/BasicMiddleware#43

@Ponant
Copy link
Contributor

Ponant commented Feb 17, 2017

@guardrex , is there any performance and parallel requests penalties in using the middleware for redirecting as compared to using the rewrite module in IIS?

@Tratcher
Copy link
Member

The IIS rewrite module would be more efficient because it runs much earlier in the pipeline.

@BiranchiParida
Copy link
Author

Thanks guys..hence i am closing the issue

ryanbrandenburg pushed a commit that referenced this issue Nov 27, 2018
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants