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: allow disable both HTTP and HTTPS interfaces #1384

Merged
merged 1 commit into from
Oct 22, 2021
Merged

nsqd: allow disable both HTTP and HTTPS interfaces #1384

merged 1 commit into from
Oct 22, 2021

Conversation

karalabe
Copy link
Contributor

@karalabe karalabe commented Oct 20, 2021

NSQD by defaults opens both the HTTP and well as the HTTPS interface by default (if TLS is set). This is fine as a default behavior, but it's valuable to be able to disable one interface or another to raise the security guarantees (e.g. if TCP is enough, there is no reason to keep 2 more ports open just to have to lock them down in some other way).

This commits allows disabling the HTTP interface the same way the HTTPS one could be disabled until now (set it to ""). In addition, it makes a few code cleanups.

@karalabe
Copy link
Contributor Author

Note, currently I can achieve a simple lockdown by configuring TLS requirements on all interfaces, but it's a bit annoying to use authentication as a means to protect an unneeded interface vs just disabling it altogether.

nsqd/nsqd.go Outdated Show resolved Hide resolved
NSQD by defaults opens both the HTTP and well as the HTTPS interface
by default (if TLS is set). This is fine as a default behavior, but
it's valuable to be able to disable one interface or another to raise
the security guarantees (e.g. if TCP is enough, there is no reason to
keep 2 more ports open just to have to lock them down in some other
way).

This commits allows disabling the HTTP interface the same way the HTTPS
one could be disabled until now (set it to ""). In addition, it makes
a few code cleanups.
return n.tcpListener.Addr().(*net.TCPAddr)

Copy link
Member

Choose a reason for hiding this comment

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

very minor: odd blank line here

@ploxiln ploxiln merged commit 802306e into nsqio:master Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants