-
Notifications
You must be signed in to change notification settings - Fork 834
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
Resuming TLSv1.3 sessions #6172
Comments
Hi,
Warm regards, Anthony |
Thanks @anhu . I have |
I noticed the documentation for Should I be implementing my own session cache and not using wolfSSL_SetServerID for TLSv1.3 connections? |
Yes, they are for TLSv1.3 resumption. You can find good examples of how to use wolfSSL_get1_session in our examples. In general, here at wolfSSL we take a very conservative stance regarding renegotiation and resumption. We always encourage a full and clean restart with a new connection whenever possible. I do not know anything about your use case, so my position remains the default which is that you should probably avoid resumption and/or renegotiation. Can you let us know a little about your project and your goals? We always love know what people are doing with our code. Warm regards, Anthony |
Thanks @anhu . Rich can tell you about our project. I have found that if I modified the client-tls13-resume.c client example to use However, in my application I see:
I can't see the difference between what I am doing and the example code, but this is quite new to me. Can you suggest reasons the binding information wouldn't match or how I could figure out what's gone wrong? |
Thanks @SparkiDev . It does seem similar to client initiated secure renegotiation in 1.2, which I understand is not desirable. Would this be called session resumption in TLS1.3? |
Resumption is the name for an abbreviated handshake using session tickets. Are you using the same ticket each time or a new ticket with each new connection? Sean |
Thanks for clarifying @SparkiDev . That's exactly what I'm trying to do for TLSv1.3. And, that was a spectacularly good question. I wasn't exactly sure what you meant by the ticket so I added a call to To cut a long day short, when using
By fail I mean, for:
I couldn't find an example for how to use What I'm trying to do is:
I couldn't find a function to do #3. How should I be doing 1 & 2? |
I tried to reproduce the issue - your test code was helpful but I can't compile it. I did see that the session is no longer being automatically stored in the client cache. What I didn't see was a binder error. I can't see anyway currently to remove the cached credentials. Sean |
Hi @SparkiDev , Thanks for the patch. I'll try it over the weekend. I've made a zip file with the user settings. It contains folders:
Removing the cached credentials only came up with the fault. Once it starts faulting, it just just stuck with failures. Aside from this issue, I assume there are cases where the session wouldn't resume properly (e.g., wifi died?) so some kind of recovery scenario would be needed. Great for me if that's handled in the library :) Have a good day, |
Patch fixed both cases, with my TLSv1.3 connection successfully resuming for all four permutations of This resolves the issue I encountered. Has this an issue with persistence of an invalid session that you mentioned above? Can I leave you to consider and close this issue when it makes sense for you please? Thanks for your help resolving this so quickly @SparkiDev . Much appreciated! |
A related issue I spotted while tidying up: Although an authority might be logical id to use, this buffer is significantly smaller than the size permitted for hostname. So The id size is
Note to future readers: if you use something like this, be sure to call |
I've put up a pull request with the previous patch and a change to hash long server IDs. Let me know if this PR works for you. Thanks, |
Thanks @SparkiDev . It looks good to me, though I was a bit confused by the lines where it seems to check for the absence of SHA-256 then uses it. Perhaps its a different SHA-256.
|
Hi @PaulMartinsen, My mistake! Thanks for looking at the PR. Sean |
Hi @PaulMartinsen, The PR has been merged and will go out in the next release which is due in the next week or so. Is there anything else for the ticket? Sean |
I think its resolved now. Thanks very much @SparkiDev & @anhu for your help in resolving this. Much appreciated! |
Thank you @PaulMartinsen! We fixed an important issue with resuming TLS v1.3. Sean :-) |
Version
5.5.4
Description
I would like to use TLSv1.3 session resumption on an embedded client to improve performance, but I can't figure out the intended architecture.
The client-tls13-resume.c example saves the session information in a local variable but this doesn't appear to use the library's session cache. So a useful test, but not the practical solution I'm looking for. Using this example, I can see the
printf("Session ID reused; Successful resume\n");
message.I found that if I call
wolfSSL_SetServerID
from my client, passing the host name for theid
, I get a resumed session on the second call (to the same server) ofwolfSSL_connect(…)
. But when making the third connection, I get aSOCKET_ERROR_E
on the client and on the serverDoTls13ClientHello
, return -423 (BAD_BINDER
) leaving me very confused. The connection is closed each time.I'm using the echoserver example on the server end. Is there an example for session resumption that employs the cache?
The text was updated successfully, but these errors were encountered: