Change project templates to have separate "http" and "https" launch profiles#42027
Merged
DamianEdwards merged 2 commits intoJun 6, 2022
Merged
Conversation
10 tasks
HaoK
approved these changes
Jun 6, 2022
captainsafia
pushed a commit
to captainsafia/aspnetcore
that referenced
this pull request
Jun 13, 2022
…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 |
Member
|
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." |
Member
|
You use the https dev cert. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In support of [EPIC] Revisiting HTTPS defaults in ASP.NET Core
Update project templates so that (assuming the
--no-httpsoption is false) two launch profiles are configured in the project'slaunchSettings.jsonfile:ApplicationUrlsproperty set to just a non-https addressApplicationUrlsproperty 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
SpaProxyare 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 runordotnet 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.