-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Cannot disable SSL Session Caching #519
Comments
I think that API (sessionCachingEnabled) is really only meaningful on the client side! And then it is only supplying session reuse hints. For the serverside, I think we need to set SslContext.getServerSessionContext().setSessionCacheSize(0); We do have a setter for the session cache size... but I can't see the value actually being used! So at the very least there is a bug there! I also think we need to check over the javadoc and make sure we are clear about server side and client side mechanisms.... Will do a bit more research before changing anything. If you get a chance to play before my research, if you could hack a call to SslContext.getServerSessionContext().setSessionCacheSize(0); it would be interesting to see if that had the desired effect of making the server reject session IDs offered in the client hello message. |
Hmmm I can't actually find a way to disable the cache on the server side! Calling Similarly for The best I can currently find is to set the cache to size 1 with a timeout of 1s. But this will still reuse lots of sessions??? Googling.... |
Improved javadoc wired up session cache size correctly
I still cannot find a way to stop the server accepting a reuse if the client offers it?!?!? |
I'm running into a similar problem. I looked at the JDK code and didn't see any obvious way of disabling SSL caching. This seems kind of hard to believe. |
I've asked stack overflow |
Improve the configuration of the SSL session cache
I cannot find a way to do this in JSSE, so unfortunately we cannot support it. |
Cool. @gregw thanks for looking into this. |
@gregw So current latest jetty behaviour is by default ssl caching enabled? If so what is default size of the cache. |
session cache size is implementation specific. (it will be different in windows / linux / osx for example) Use the default built-in API to determine what the cache size for your particular environment. |
Jetty's The problem is that JDK's session cache size cannot be disabled. |
so by default without doing anything the ssl cache is enabled in jetty? |
Assuming the underlying objective is to ensure that a session won't be re-used, it sounds like the way to do that is to immediately invalidate the session when it's established. If a session is invalidated, I assume caching can be disregarded. The session should be unavailable for resuming or rejoining. Existing connections may continue to use the session until the connection is closed. Yes? https://stackoverflow.com/questions/38912506/how-to-disable-javas-ssl-session-resumption Disclaimer: I'm not at all familiar with JSSE so someone else will need to check this. Was just rooting around the problem and found something that sounded plausible enough to be worth suggesting. CC @haus |
You could try that out, make a new class, extend it off of public void customize(Connector connector, HttpConfiguration channelConfig, Request request) Unwrap the secure connection, get the endpoint, and invalidating the ssl session. See When you are done, archive your new class in a new jar file. Then add it to your |
Recently we added a setting to our application which allows ssl session caching to be configurable. We did this by calling setSessionCachingEnabled with false when creating the ssl context. This appears to have no effect on whether or not ssl sessions are cached. At a glance this appears similar to https://bugs.eclipse.org/bugs/show_bug.cgi?id=418892 but in reverse. While that bug was about caching not working when enabled, this issue is about it working even when disabled.
To reproduce:
java -jar start.jar --add-to-start=https
java -jar start.jar etc/tweak-ssl.xml
openssl s_client -reconnect -connect 127.0.0.1:8443 | grep Session-ID:
Expected:
A list of 6 different session IDs (1 for initial connect, 5 more for each reconnection).
Actual:
The text was updated successfully, but these errors were encountered: