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

nsqd: enable support for TLS1.3 #1385

Merged
merged 1 commit into from
Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/nsqd/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ func (t *tlsMinVersionOption) Set(s string) error {
*t = tls.VersionTLS11
case "tls1.2":
*t = tls.VersionTLS12
case "tls1.3":
*t = tls.VersionTLS13
default:
return fmt.Errorf("unknown tlsVersionOption %q", s)
}
Expand Down Expand Up @@ -178,7 +180,7 @@ func nsqdFlagSet(opts *nsqd.Options) *flag.FlagSet {
tlsRequired := tlsRequiredOption(opts.TLSRequired)
tlsMinVersion := tlsMinVersionOption(opts.TLSMinVersion)
flagSet.Var(&tlsRequired, "tls-required", "require TLS for client connections (true, false, tcp-https)")
flagSet.Var(&tlsMinVersion, "tls-min-version", "minimum SSL/TLS version acceptable ('ssl3.0', 'tls1.0', 'tls1.1', or 'tls1.2')")
flagSet.Var(&tlsMinVersion, "tls-min-version", "minimum SSL/TLS version acceptable ('ssl3.0', 'tls1.0', 'tls1.1', 'tls1.2' or 'tls1.3')")

// compression
flagSet.Bool("deflate", opts.DeflateEnabled, "enable deflate feature negotiation (client compression)")
Expand Down
1 change: 0 additions & 1 deletion nsqd/nsqd.go
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,6 @@ func buildTLSConfig(opts *Options) (*tls.Config, error) {
Certificates: []tls.Certificate{cert},
ClientAuth: tlsClientAuthPolicy,
MinVersion: opts.TLSMinVersion,
MaxVersion: tls.VersionTLS12, // enable TLS_FALLBACK_SCSV prior to Go 1.5: https://go-review.googlesource.com/#/c/1776/
}

if opts.TLSRootCAFile != "" {
Expand Down
6 changes: 3 additions & 3 deletions nsqd/protocol_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ func TestTLSAuthRequire(t *testing.T) {
InsecureSkipVerify: true,
}
tlsConn := tls.Client(conn, tlsConfig)
err = tlsConn.Handshake()
_, err = nsq.ReadResponse(tlsConn)
test.NotNil(t, err)

// With Unsigned Cert
Expand Down Expand Up @@ -1004,7 +1004,7 @@ func TestTLSAuthRequireVerify(t *testing.T) {
InsecureSkipVerify: true,
}
tlsConn := tls.Client(conn, tlsConfig)
err = tlsConn.Handshake()
_, err = nsq.ReadResponse(tlsConn)
test.NotNil(t, err)

// with invalid cert
Expand All @@ -1028,7 +1028,7 @@ func TestTLSAuthRequireVerify(t *testing.T) {
InsecureSkipVerify: true,
}
tlsConn = tls.Client(conn, tlsConfig)
err = tlsConn.Handshake()
_, err = nsq.ReadResponse(tlsConn)
test.NotNil(t, err)

// with valid cert
Expand Down