-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Change project templates to have separate "http" and "https" launch profiles #42027
Change project templates to have separate "http" and "https" launch profiles #42027
Conversation
…rofiles (dotnet#42027) * Project templates have separate "http" and "https" launch profiles * Update test targets for dotnet-ef targeting net6.0 Fixes dotnet#41982
Make sure that you also have settings for HTTPS in the appsettings.json file. You may need settings to allow the use of HTTPS as well as paths related to SSL certificate and private key.
OR
|
This setting isn't needed. Why do you need it? What operating system are you running on? |
Yes, normally it's not needed, but when I want to use the dotnet watch run command and I also need HTTPS, I use these settings." |
You use the https dev cert. |
In support of [EPIC] Revisiting HTTPS defaults in ASP.NET Core
Update project templates so that (assuming the
--no-https
option is false) two launch profiles are configured in the project'slaunchSettings.json
file:ApplicationUrls
property set to just a non-https addressApplicationUrls
property set to the usual two addresses, the first being https, the second being http:Selecting an auth option of anything other than None or Indvidual in relevant templates will still force https like today & only create a single launch profile due to issues with these auth schemes use of cookies and SameSite.
The Angular & SPA templates that utilize the
SpaProxy
are currently authored in such a way that only https works (irrespective of the auth option) so they're not changed.When launching this project at the command line using
dotnet run
ordotnet watch
, the default profile selected will be the first profile, which is not configured to use https, and as such the application will start without attempting to bind to https and thus not attempt to load the dev cert (which causes UX friction issues esp. on non-Windows systems). The https profile can be selected at launch time by passing--launch-profile <launch-profile>
todotnet run
, e.g.:The project will continue to have the https-aware code present so the project is ready for use with https.