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

Togglable TLS Redirect #1322

Conversation

Legogris
Copy link
Contributor

@Legogris Legogris commented Jun 6, 2019

Add a flag TLS_REDIRECT (default off) which can be used to enforce TLS redirection for unencrypted HTTP connections.

@dimroc
Copy link
Contributor

dimroc commented Jun 7, 2019

Hey there @Legogris, while we discuss merging this PR, would setting CHAINLINK_TLS_PORT=0 achieve the same goal? It might at the very least unblock you. We're all for explicit flags, but are on the fence with this one. Is there a new scenario you would to support here? Like allowing both HTTP and HTTPS?

CHAINLINK_TLS_PORT=0
CHAINLINK_TLS_REDIRECT=false

@se3000 se3000 changed the base branch from master to develop June 9, 2019 19:35
@Legogris
Copy link
Contributor Author

Legogris commented Jun 11, 2019

@dimroc I would actually like the inverse; having TLS_PORT = 0 while still doing redirect from HTTP to HTTPS (since we're putting an LB in front doing TLS termination for us).
So the use-case would be only serving unencrypted HTTP form the container while still doing redirect to https.
Since TLS_PORT != 0 is used to determine more than one behavior it is a bit coarse as is.

@j16r
Copy link
Contributor

j16r commented Jun 17, 2019

@Legogris did this work for your setup?

@Legogris
Copy link
Contributor Author

Legogris commented Jun 28, 2019

@j16r It did achieve exactly what's under scope here and I do think this is going to be a somewhat common deployment scenario. But to solve it fully for our specific scenario it's not sufficient; because we are using a Google Cloud Load Balancer on a Kubernetes Ingress, which enforces a health check that is hard on / returning 200 OK.
It does work fine if you would, in the Chainlink node, add a hardcoded case where requests for / just returns an empty 200 OK if the User-Agent is identified to be the GCLB health check agent regardless of authentication status.

But in the end we went with using a sidecard container which proxies all requests except those ones to the Chainlink node and returns an HTTP code based on the health of the Chainlink node container.

@j16r
Copy link
Contributor

j16r commented Jul 8, 2019

@Legogris
Copy link
Contributor Author

Would you mind adding this new variable to the presenter: https://github.com/smartcontractkit/chainlink/blob/develop/core/store/presenters/presenters.go#L149
@Legogris?

Sure!

@se3000
Copy link
Contributor

se3000 commented Aug 1, 2019

@Legogris any update on this? Looks like it needs a rebase at this point.

This was referenced Aug 14, 2019
@se3000
Copy link
Contributor

se3000 commented Aug 14, 2019

closing in favor of #1546

@se3000 se3000 closed this Aug 14, 2019
@Legogris
Copy link
Contributor Author

@se3000 Thanks for taking the time to sort this out :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants