-
Notifications
You must be signed in to change notification settings - Fork 2k
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
TLS support for http and RPC #1853
Conversation
f834ea5
to
348382c
Compare
348382c
to
0e6e5b3
Compare
@@ -164,12 +165,22 @@ var ( | |||
|
|||
// NewClient is used to create a new client from the given configuration | |||
func NewClient(cfg *config.Config, consulSyncer *consul.Syncer, logger *log.Logger) (*Client, error) { | |||
//Create the tls wrapper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space after //
@@ -132,6 +133,32 @@ type Config struct { | |||
// PublishAllocationMetrics determines whether nomad is going to publish | |||
// allocation metrics to remote Telemetry sinks | |||
PublishAllocationMetrics bool | |||
|
|||
// HttpTLS enables TLS for the HTTP endpoints on the clients. | |||
HttpTLS bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you just embed the TLSConfig struct
|
||
// CAFile is a path to a certificate authority file. This is used with VerifyIncoming | ||
// or VerifyOutgoing to verify the TLS connection. | ||
CAFile string `mapstructure:"ca_file"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing CAPath
@@ -191,6 +192,29 @@ type Config struct { | |||
// This period is meant to be long enough for a leader election to take | |||
// place, and a small jitter is applied to avoid a thundering herd. | |||
RPCHoldTimeout time.Duration | |||
|
|||
// Enable TLS for incoming RPC calls from Nomad clients | |||
RpcTLS bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here
@@ -0,0 +1,237 @@ | |||
package tlsutil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be in helper pkg?
@@ -0,0 +1,17 @@ | |||
-----BEGIN CERTIFICATE----- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be in a subdirectory under the tlsutil, not at the top level
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
A subsequent PR is going to introduce support for TLS in the Nomad CLI and API client lib.