Set new HTTPS environment variable when using out of process #16713
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.
Fixes #15243.
Today, ANCMV2 started setting the ASPNETCORE_HTTPS_PORT. This affected 2.2 applications that updated ANCMV2 to start always redirecting to HTTPS if the RedirectionMiddleware was enabled, as redirecting didn't work in 2.2 with ANCM.
This fix adds a new HTTPS_PORT environment variable called ANCM_HTTPS_PORT, which is now set by ANCM instead of HTTPS_PORT. The HttpsRedirectionMiddleware has also been updated to start reading this new value as a backup to the HTTPS_PORT. This means that if HTTPS_PORT is set, it will still always win over the ANCM port.
@BillHiebert this could affect IISExpress; when you set the HTTPS_PORT, do you set it to the HTTPS_PORT iisexpress is going to listen on? If so, then this change shouldn't break anything; the HTTPS_PORT still wins.
WIP because I still want to add another test with the HttpsRedirectionMiddleware.
@Pilchie for 3.1 approval