utls
utls copied to clipboard
Support for TLS1.2 SessionID Based Resumption
Add support for TLS1.2 session ID based resumption. Some clients notably iOS NSURLSession by default only support session id based resumption for TLS1.2 so it would be useful to be able to support session id based resumption.
This adds SessionIdEnabled which defaults to false to preserve backwards compatibility and ServerSessionCache for storing sessionId based sessions to the tls Config object. We do not supply an implementation of ServerSessionCache like the LRU client cache. I am not particularly interested in getting session id based resumption working for the server and only have provided an implementation so the client implementation can easily be tested.
The changes to the normal Golang TLS server/client seem straight forward but I'm not so sure about the uTLS changes in particular ApplyPresets which now unconditionally calls SetSessionState whereas previously it only called SetSessionState if the SessionTicketExtension was present. Also, the SetSessionCache method now does not make sense since it unconditionally sets TicketSupported = true
even though the SessionCache
can now be used without session tickets.