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

cmd, node, rpc: TLS support #3506

Closed
wants to merge 1 commit into from
Closed

cmd, node, rpc: TLS support #3506

wants to merge 1 commit into from

Conversation

farazdagi
Copy link
Contributor

What?

  • This PR has basic support for transport layer security, and allows servicing RPC requests on HTTPS.
  • Both server and console have been updated i.e. you can use geth attach to connect to TLS-enabled node
  • Support for self-signed certificates (again both server and client side) has been added
  • Extra utils to auto-generate self-signed certificate/key

Why?

  • the obvious solution whenever one needs to fix mixed content issues (when you load your Dapp on https and connect to node running on http directly), was to use intermediary relay server, as outlined in comments to Connecting a HTTPS WebAPP to Ethereum #2121
  • moreover, it has been stated that the RPC server functionality being targeted to developers probably doesn't need TLS support at all
  • one possible use case we have discovered is when Dapps running on Status were communicating with underlying Geth node directly (on mobile device, we try to minimize number of intermediaries, so running the relay server is probably not the best idea)

Details

Server:

# start node, enable TLS, use provided cert/key
geth --testnet --light --rpc --tls --tlscert cert.pem --tlskey key.pem console

# start node, enable TLS, auto-generate cert/key
geth --testnet --light --rpc --tls console

Client:

# connect to TLS-enabled node, use given certificate, treat certificate as its own CA
geth --tlscert tlscert.pem --tlskey tlskey.pem --tlscertca attach https://localhost:8545

# connect to TLS-enabled node, make sure that client accepts any key provided by server
# (including self-signed certificate)
geth --tlsnoverify attach https://localhost:8545

# connect to TLS-enabled node, which uses certificate signed by known CA
geth --tlsnoverify attach https://localhost:8545

Roadmap

  • as no prior discussion has been held, the purpose of this PR, at this stage, is more to gauge interest than anything else
  • if there will be interest to merge the thingy, then tests will be provided, and overall polishing attempted (guided by recommendations/comments from the core team)
  • if there will be no intent to merge, then this PR should be closed. Hopefully, someone looking for TLS-support will be able to locate the PR and, effectively, have a good starting point (thus, community can still benefit)

@mention-bot
Copy link

@farazdagi, thanks for your PR! By analyzing the history of the files in this pull request, we identified @fjl, @karalabe and @kenji-isuntv to be potential reviewers.

@obscuren
Copy link
Contributor

Sorry for the late response and thank you for your PR. We're discussing this internally

@obscuren
Copy link
Contributor

We've discussed internally and here's what we decided:

  • We'd like to get TLS support for RPC in 1.6 (next version, ~2-4 weeks)
  • We like to support TLS through configuration files (not yet supported)
  • We do not want TLS to be configurable through CLI flags

Are you interested in doing the extra work once configuration files have been implemented?

@farazdagi
Copy link
Contributor Author

@obscuren
Copy link
Contributor

obscuren commented Feb 15, 2017

@farazdagi: @fjl will reimplement the configuration PR. We've decided to take a different approach. #3424 maps CLI flags directly through configuration; instead we want to add hierarchal configuration options by mapping them directly to our internal config structs.

@fjl: please ping this PR.

@obscuren obscuren modified the milestone: 1.6.0 Feb 18, 2017
@fjl
Copy link
Contributor

fjl commented Apr 10, 2017

We're postponing this this 1.6.1. The RPC server configuration mechanism will be reworked and I'll add support for TLS then.

@fjl fjl closed this Apr 10, 2017
@nwilson1412
Copy link

Hi any update on this, as 1.6.1 is out?

@karalabe
Copy link
Member

karalabe commented Oct 28, 2017 via email

@jozanza
Copy link

jozanza commented Nov 28, 2017

Yeah I'd also love an update on this one if possible

@fjl
Copy link
Contributor

fjl commented Dec 1, 2017

We got distracted by other stuff and didn't implement new configuration for RPC endpoints. This is up for grabs if anyone wants to do it.

@pranavburnwal
Copy link

+1
Need this...

@tamama
Copy link

tamama commented Apr 24, 2018

+1
#16554

@sanguohot
Copy link

+1
Need it···

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.

10 participants