Project

General

Profile

Actions

Bug #3075

closed

TLS 1.3 with SessionTicket fail for the first 8 hours of 1970

Added by DamienT about 4 years ago. Updated about 4 years ago.

Status:
Fixed
Priority:
Normal
Category:
TLS
Target version:
ASK QUESTIONS IN Forums:
No

Description

I've recently switched for an embedded project from lighttpd 1.4.55 to 1.4.58 and started having issues in some cases when connecting using https with all clients (Firefox, Chrome, curl, ...) that failed with an error about TLS session ticket (see attached curl logs).

After some investigation it appears that the issue occured only on devices that had their date set between 1970-01-01 00:00:00 and 1970-01-01 07:00:00.
(embedded devices are more prone to be in 1970 as they don't always have a RTC to keep date and time)

In addition I've seen that the default openssl parameters changed from "Options" => "ServerPreference,-SessionTicket" in 1.4.55 to "Options" => "ServerPreference" in 1.4.56 (as described in the wiki [1]) which is why I didn't see the issue before upgrading.

Using "-SessionTicket" in the configuration file was a workaround but I think a proper fix would be better.

I've looked a little bit in mod_openssl.c:
First stek_rotate_ts is initialized to 0.
Then in mod_openssl_session_ticket_key_check, the code checks if (cur_ts-28800) is greater than stek_rotate_ts
However as we are early 1970 it's not the case so the ticket is not generated until 28800 seconds passed which is 8 hours.

I've made a quick patch (see attached) which is maybe not the best but mostly fixed the problem for me.

[1] https://redmine.lighttpd.net/projects/1/wiki/docs_ssl#Perfect-Forward-Secrecy-PFS


Files


Related issues 1 (0 open1 closed)

Has duplicate Bug #3080: Lighttpd 1.4.58 SSL connections stop working if system time of lighttpd server is changed to future one (+12h or even days)DuplicateActions

Added by gstrauss about 4 years ago

Revision d50d4dc0 (diff)

[TLS] init STEK even if time is 1970 (fixes #3075)

(thx DamienT)

x-ref:
"TLS 1.3 with SessionTicket fail for the first 8 hours of 1970"
https://redmine.lighttpd.net/issues/3075

Added by gstrauss about 4 years ago

Revision 0ee96426 (diff)

[core] restart if large large clock jump detected (#3075)

default is clock jump > 30 mins (1800 seconds)
server.feature-flags += ("server.clock-jump-restart" => 1800)
Can be set to 0 to disable.

x-ref:
"TLS 1.3 with SessionTicket fail for the first 8 hours of 1970"
https://redmine.lighttpd.net/issues/3075

Actions

Also available in: Atom