Skip to content

Add TLS encryption#13

Open
mahdi-orbitalize wants to merge 6 commits into
add_raft_transportfrom
add_tls_encryption
Open

Add TLS encryption#13
mahdi-orbitalize wants to merge 6 commits into
add_raft_transportfrom
add_tls_encryption

Conversation

@mahdi-orbitalize
Copy link
Copy Markdown

What I did:

  • consensus.go was updated to enable client-side (handled by rafthttp if we provide a transport.TLSInfo when constructing a rafthttp.transport) and server-side (handled by extracting a tls.Config from the transport.TLSInfo and passing it to the server at construction plus using ListenAndServeTLS instead of ListenAndServe)
  • gen-cert.sh was introduced to make certificates (with the number of nodes as a parameter). Note that it's made to work for local setups (i.e. address is localhost or 127.0.0.1). I also provided example certificates to save the trouble of generating them.
  • params.go was updated to support passing the paths to the TLS certificates as a parameter. It also enforces the use of HTTPS instead of HTTP for the peers' URLs. Also, more tests were added to params_test.go to test the new features.
  • start_cluster.sh was created to quickly test a 3-node setup with TLS and easily inspect logs.

How I tested it:

  • Verified that logs where similar when trying with/without encryption (and that it fails when it's supposed to fail)

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.

1 participant