[WIP] tls: add server.sessionTimeout getter and setter.#34006
Closed
mkrawczuk wants to merge 1 commit intonodejs:masterfrom
Closed
[WIP] tls: add server.sessionTimeout getter and setter.#34006mkrawczuk wants to merge 1 commit intonodejs:masterfrom
mkrawczuk wants to merge 1 commit intonodejs:masterfrom
Conversation
This change enables dynamical change of tls.Server's session timeout. TODO: * finish tests * add doc
bnoordhuis
reviewed
Jun 23, 2020
Member
bnoordhuis
left a comment
There was a problem hiding this comment.
I'd be okay with a test that tests types/ranges and verifies that setting the value is reflected by the getter.
Testing whether the session actually expires would be nice but I can see how it'd be complicated and not very reliable / timing sensitive.
Comment on lines
+1384
to
+1385
| long sessionTimeout = SSL_CTX_get_timeout(sc->ctx_.get()); | ||
| args.GetReturnValue().Set(static_cast<uint32_t>(sessionTimeout)); |
Member
There was a problem hiding this comment.
I recognize the same style issue exists in SetSessionTimeout() but...
Suggested change
| long sessionTimeout = SSL_CTX_get_timeout(sc->ctx_.get()); | |
| args.GetReturnValue().Set(static_cast<uint32_t>(sessionTimeout)); | |
| long session_timeout = SSL_CTX_get_timeout(sc->ctx_.get()); | |
| args.GetReturnValue().Set(static_cast<uint32_t>(session_timeout)); |
(and I'm going to guess the first line needs a // NOLINT(runtime/int) to shut up cpplint)
Comment on lines
+1
to
+21
| // Copyright Joyent, Inc. and other Node contributors. | ||
| // | ||
| // Permission is hereby granted, free of charge, to any person obtaining a | ||
| // copy of this software and associated documentation files (the | ||
| // "Software"), to deal in the Software without restriction, including | ||
| // without limitation the rights to use, copy, modify, merge, publish, | ||
| // distribute, sublicense, and/or sell copies of the Software, and to permit | ||
| // persons to whom the Software is furnished to do so, subject to the | ||
| // following conditions: | ||
| // | ||
| // The above copyright notice and this permission notice shall be included | ||
| // in all copies or substantial portions of the Software. | ||
| // | ||
| // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
| // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | ||
| // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | ||
| // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
| // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | ||
| // USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
|
Member
There was a problem hiding this comment.
Suggested change
| // Copyright Joyent, Inc. and other Node contributors. | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a | |
| // copy of this software and associated documentation files (the | |
| // "Software"), to deal in the Software without restriction, including | |
| // without limitation the rights to use, copy, modify, merge, publish, | |
| // distribute, sublicense, and/or sell copies of the Software, and to permit | |
| // persons to whom the Software is furnished to do so, subject to the | |
| // following conditions: | |
| // | |
| // The above copyright notice and this permission notice shall be included | |
| // in all copies or substantial portions of the Software. | |
| // | |
| // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |
| // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
| // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | |
| // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | |
| // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | |
| // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | |
| // USE OR OTHER DEALINGS IN THE SOFTWARE. |
(not necessary in new test files)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change enables dynamical change of tls.Server's session timeout. It is a follow-up to #33974.
I would like to ask for help and suggestions on writing appropriate tests for these methods. At first I wanted to count new and resumed sessions from the event callbacks, but it turned out they are not called when the client is using the session ticket feature.