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

[xserver] TLS support added to xserver, aggregator server, and aggregator client #4283

Merged
merged 52 commits into from
Oct 16, 2024

Conversation

roman-mazhut
Copy link
Contributor

What this PR does / why we need it:

TLS support was added to xserver and aggregator client.
The server supports 3 modes: disabled(allows plaintext connections only), permissive(allows both plaintext and TLS connections), and enforced(TLS connections only). Also, mutual TLS can be enabled in the server config.

Special notes for your reviewer:

Does this PR introduce a user-facing and/or backwards incompatible change?:

To enable TLS support for the xserver a new section `tls` should be added to the server config. For instance:
----
rawtcp:
  listenAddress: 0.0.0.0:6403
  tls:
    mode: permissive
    mTLSEnabled: true
    certFile: /tmp/server.crt
    keyFile: /tmp/server.key
    clientCAFile: /tmp/rootCA.crt  # required for mTLS
    certificatesTTL: 1h
----

To enable TLS support for the aggregator client a new section `tls` should be added to the client config.
----
connection:
  tls:
    enabled: true
    insecureSkipVerify: false
    serverName: myserver
    caFile: /tmp/rootCA.crt
    certFile: /tmp/client.crt  # required for mTLS
    keyFile: /tmp/client.key  # required for mTLS
----

Benchmarks:
---
go test -bench=. -benchtime=40s -shuffle on
goos: linux
goarch: amd64
pkg: github.com/m3db/m3/src/x/server
cpu: AMD EPYC 7B13

# Create a connection for every data write
BenchmarkPlainTCPServer-96                           641020          202226 ns/op
BenchmarkTLSServer-96                                   24619             1936240 ns/op
BenchmarkMTLSServer-96                                15334            3193834 ns/op

# Use one connection for all data writes
BenchmarkKeepAlivePlainTCPServer-96          10322742      4630 ns/op
BenchmarkKeepAliveMTLSServer-96               12344016      4522 ns/op
BenchmarkKeepAliveTLSServer-96                   10149930      4924 ns/op
---

Does this PR require updating code package or user-facing documentation?:

NONE

roman-mazhut and others added 30 commits April 18, 2024 12:16
Copy link
Contributor

@andrewmains12 andrewmains12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving based on review on #4266

@roman-mazhut roman-mazhut merged commit d39979b into master Oct 16, 2024
5 checks passed
@roman-mazhut roman-mazhut deleted the add-support-of-tls-to-tcp-client branch October 16, 2024 14:05
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.

6 participants