Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
adec2c06
Commit
adec2c06
authored
Jul 24, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Set SSL/TLS session timeout to 12 hours
parent
6c8243f6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
src/shrpx.cc
src/shrpx.cc
+8
-3
src/shrpx_config.h
src/shrpx_config.h
+1
-0
src/shrpx_ssl.cc
src/shrpx_ssl.cc
+1
-0
No files found.
src/shrpx.cc
View file @
adec2c06
...
...
@@ -643,15 +643,19 @@ void renew_ticket_key_cb(struct ev_loop *loop, ev_timer *w, int revents) {
// possible problem when one worker encrypt new key, but one worker,
// which did not take the that key yet, and cannot decrypt it.
//
// We keep keys for
12 hours. Thus the maximum ticket vector siz
e
//
is 12 + 1
.
// We keep keys for
get_config()->tls_session_timeout seconds. Th
e
//
default is 12 hours. Thus the maximum ticket vector size is 12
.
if
(
old_ticket_keys
)
{
auto
&
old_keys
=
old_ticket_keys
->
keys
;
auto
&
new_keys
=
ticket_keys
->
keys
;
assert
(
!
old_keys
.
empty
());
new_keys
.
resize
(
std
::
min
(
12ul
,
old_keys
.
size
()
+
1
));
auto
max_tickets
=
static_cast
<
size_t
>
(
std
::
chrono
::
duration_cast
<
std
::
chrono
::
hours
>
(
get_config
()
->
tls_session_timeout
).
count
());
new_keys
.
resize
(
std
::
min
(
max_tickets
,
old_keys
.
size
()
+
1
));
std
::
copy_n
(
std
::
begin
(
old_keys
),
new_keys
.
size
()
-
1
,
std
::
begin
(
new_keys
)
+
1
);
}
else
{
...
...
@@ -1016,6 +1020,7 @@ void fill_default_config() {
mod_config
()
->
downstream_addr_group_catch_all
=
0
;
mod_config
()
->
tls_ticket_cipher
=
EVP_aes_128_cbc
();
mod_config
()
->
tls_ticket_cipher_given
=
false
;
mod_config
()
->
tls_session_timeout
=
std
::
chrono
::
hours
(
12
);
}
}
// namespace
...
...
src/shrpx_config.h
View file @
adec2c06
...
...
@@ -253,6 +253,7 @@ struct Config {
std
::
vector
<
std
::
string
>
tls_proto_list
;
// binary form of http proxy host and port
sockaddr_union
downstream_http_proxy_addr
;
std
::
chrono
::
seconds
tls_session_timeout
;
ev_tstamp
http2_upstream_read_timeout
;
ev_tstamp
upstream_read_timeout
;
ev_tstamp
upstream_write_timeout
;
...
...
src/shrpx_ssl.cc
View file @
adec2c06
...
...
@@ -346,6 +346,7 @@ SSL_CTX *create_ssl_context(const char *private_key_file,
const
unsigned
char
sid_ctx
[]
=
"shrpx"
;
SSL_CTX_set_session_id_context
(
ssl_ctx
,
sid_ctx
,
sizeof
(
sid_ctx
)
-
1
);
SSL_CTX_set_session_cache_mode
(
ssl_ctx
,
SSL_SESS_CACHE_SERVER
);
SSL_CTX_set_timeout
(
ssl_ctx
,
get_config
()
->
tls_session_timeout
.
count
());
const
char
*
ciphers
;
if
(
get_config
()
->
ciphers
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment