-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Can't get HTTPS to work on Azure Websites #1331
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
Comments
You need to add the "Microsoft.AspNetCore.Server.Kestrel.Https" and call app.UseKestrelHttps in your Startup.Configure method. This guide shows how to do the full setup including exporting certs. Since you are using rc2, you shouldn't need to use the ChangeContextToHttps workaround in that blog post. If all else fails, you can see if you can get the Kestrel sample working which uses HTTPS. |
@halter73 I thought that since I'm using Azure Websites, I'm forced to use IIS? |
IIS is actually forwarding requests to Kestrel using the HttpPlatformHandler IIS module that proxies requests to Kestrel. The following announcement covers some of the reasoning behind this decision: aspnet/Announcements#69 However, you're right that you probably should be using IIS for SSL/TLS termination. Did you try following the steps in this guide? https://azure.microsoft.com/en-us/documentation/articles/web-sites-dotnet-deploy-aspnet-mvc-app-membership-oauth-sql-database/#enable-ssl-for-the-project BTW, does the browser establish an HTTPS connection and it's just the middleware that is showing the wrong scheme? |
@halter73 FYI, @flagbug's bug is caused by recent changes in the override middleware. I've posted more details there: aspnet/BasicMiddleware#18 (comment) |
This issue is being closed because it has not been updated in 3 months. We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate. |
I've deployed my ASP.NET Core 1.0 app to Azure Websites, but for some reason, I can't get HTTPS to work.
These are the package versions I'm using:
With DNX
1.0.0-rc2-16551
My startup class looks like this: https://gist.github.com/flagbug/3558413482511986421c
My web.config file contains the following entry to force HTTPS:
To determine the scheme a request is using, I'm using
which always returns "http", even though I'm calling my site on a https address
// cc @PinpointTownes who was interested in this issue
The text was updated successfully, but these errors were encountered: