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

X_FORWARDED_PROTO with multiple proxy steps not supported #13451

Closed
bpicolo opened this issue Jan 26, 2017 · 1 comment
Closed

X_FORWARDED_PROTO with multiple proxy steps not supported #13451

bpicolo opened this issue Jan 26, 2017 · 1 comment
Assignees
Labels
Milestone

Comments

@bpicolo
Copy link

bpicolo commented Jan 26, 2017

What steps will reproduce the problem?

Call Yii::$app->getRequest()->getIsSecureConnection() when $_SERVER['HTTP_X_FORWARDED_PROTO'] = 'https,http'

What is the expected result?

true

What do you get instead?

false

Additional info

X_FORWARDED_PROTO is a de-facto rather than a canonical http field. It seems the common definition is to add, as comma-separated values, the different protocols used when multiple proxies lie in front of your application. (See https://en.wikipedia.org/wiki/X-Forwarded-For#Format)

I think it makes the most sense for the connection to be considered secure if the Edge node (first step in the chain) is secure, because that's the most common use case. An example would be terminating SSL at an external load balancer / cdn, and forwarding over HTTP to an internal load-balancer.

@samdark samdark added the type:bug Bug label Jan 26, 2017
@samdark samdark added this to the 2.0.12 milestone Jan 26, 2017
@samdark samdark self-assigned this Jan 26, 2017
@samdark samdark modified the milestones: 2.0.13, 2.0.12 Apr 26, 2017
@samdark
Copy link
Member

samdark commented Oct 4, 2017

Already fixed by #13780

@samdark samdark closed this as completed Oct 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants