lighthouse/beacon_node/http_api/src
Mac L a73d698e30 Add TLS capability to the beacon node HTTP API (#2668)
Currently, the beacon node has no ability to serve the HTTP API over TLS.
Adding this functionality would be helpful for certain use cases, such as when you need a validator client to connect to a backup beacon node which is outside your local network, and the use of an SSH tunnel or reverse proxy would be inappropriate.

## Proposed Changes

- Add three new CLI flags to the beacon node
  - `--http-enable-tls`: enables TLS
  - `--http-tls-cert`: to specify the path to the certificate file
  - `--http-tls-key`: to specify the path to the key file
- Update the HTTP API to optionally use `warp`'s [`TlsServer`](https://docs.rs/warp/0.3.1/warp/struct.TlsServer.html) depending on the presence of the `--http-enable-tls` flag
- Update tests and docs
- Use a custom branch for `warp` to ensure proper error handling

## Additional Info

Serving the API over TLS should currently be considered experimental. The reason for this is that it uses code from an [unmerged PR](https://github.com/seanmonstar/warp/pull/717). This commit provides the `try_bind_with_graceful_shutdown` method to `warp`, which is helpful for controlling error flow when the TLS configuration is invalid (cert/key files don't exist, incorrect permissions, etc). 
I've implemented the same code in my [branch here](https://github.com/macladson/warp/tree/tls).

Once the code has been reviewed and merged upstream into `warp`, we can remove the dependency on my branch and the feature can be considered more stable.

Currently, the private key file must not be password-protected in order to be read into Lighthouse.
2021-10-12 03:35:49 +00:00
..
attester_duties.rs Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
block_id.rs Use the forwards iterator more often (#2376) 2021-05-31 04:18:20 +00:00
database.rs Implement checkpoint sync (#2244) 2021-09-22 00:37:28 +00:00
lib.rs Add TLS capability to the beacon node HTTP API (#2668) 2021-10-12 03:35:49 +00:00
metrics.rs Metrics and DEBG log for late gossip blocks (#2533) 2021-08-23 00:59:14 +00:00
proposer_duties.rs Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
state_id.rs Fork schedule api (#2525) 2021-08-24 01:36:27 +00:00
sync_committees.rs Validator monitor support for sync committees (#2476) 2021-08-31 23:31:36 +00:00
validator_inclusion.rs Validator monitor support for sync committees (#2476) 2021-08-31 23:31:36 +00:00
version.rs Altair validator client and HTTP API (#2404) 2021-08-06 00:47:31 +00:00