-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
add Transport config options to limit the number of handshakes #4248
Conversation
1b455b5
to
80c52e4
Compare
908a1ae
to
28c730d
Compare
80c52e4
to
80194b5
Compare
80194b5
to
6dfc56d
Compare
6dfc56d
to
7951e15
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #4248 +/- ##
==========================================
- Coverage 84.09% 84.08% -0.00%
==========================================
Files 150 150
Lines 15401 15431 +30
==========================================
+ Hits 12950 12975 +25
- Misses 1950 1953 +3
- Partials 501 503 +2 ☔ View full report in Codecov by Sentry. |
transport.go
Outdated
@@ -18,6 +18,11 @@ import ( | |||
|
|||
var errListenerAlreadySet = errors.New("listener already set") | |||
|
|||
const ( | |||
defaultMaxNumUnvalidatedHandshakes = 32 | |||
defaultMaxNumHandshakes = 64 |
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 values seem unreasonably low.
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.
Maybe we should set defaultMaxNumHandshakes
to unlimited? It's really hard to pick a limit that fits for all.
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.
64 feels too low for defaultMaxNumHandshakes
. This number is way too easy to DoS for even very small machines. I think a high value > 1000 is better. I think unlimited is also better than this being < 1000.
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.
Changed to unlimited in 77ede93. Not entirely happy with that, but we can always change it later once we come up with a better value.
77ede93
to
ded0673
Compare
…go#4248) * add Transport config options to limit the number of handshakes * fix accounting for failed handshakes * increase handshake limits, improve documentation
Fixes #3549.