-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Custom ssl engine parameters #639
Conversation
Extending the Nio and Nio2 enpoints was not possible to associate custom channels unless the method setSocketOption is not modified. However, in some context could be required to use custom Nio?Channels without changes in the endpoint. A new method, createChannel(), is introduced to generate the channel. Extensions of Nio endpoints have to reimplement only this method to associate a different channel.
This looks good to me, but I'd appreciate someone with more in-depth knowledge of the protocol handlers to weigh-in. The only thing that caught my eye was that the signature of This pull request is against |
Hi @ChristopherSchultz, the The only problem with back-porting I can think of it is that classes extending the |
Extensions of the SecureNioChannel and SecureNio2Channel could require to modify the sslengine before it get used for SNI and/or handshake. The creation has been moved on a separate method which can be override. This is useful if the ssl engine would require parameters from the underlying connection for audit or debugging.
75f5348
to
b21f5da
Compare
This proposed change looks good to me. |
I merged this change to Tomcat main branch (11). Backporting is not straightforward however as this is an API change stacked on top of a previous API change for Tomcat 11, so the code that uses it would be tied to 11 anyway. |
@rmaucher thanks for the merge. I have tested cherry-picking to tomcat 9 and it required a couple of minor fixes to work. Is there something I can do to facilitate the backport? |
This seems difficult, AbstractJsseEndpoint would be the spot (same for 10.1), but it would be an incompatible API change (so probably not ok), and code written for 11 would not be compatible anyway. |
Yes, the API would be slightly different between version 9 and 11. |
Deploying tomcat with a custom ssl engine could require to perform some extra configuration before its usage. As an example, tomcatjss project needs to provide the actual IPs of client and server for audit purpose.
To provide the IPs we are working on a patch which require to copy several tomcat methods from NIO endpoint and channel because the current implementation does not allow to access the ssl engine before it is used (the method to be replaced are in this PR).
Changes in this PR allow to extend tomcat NIO classes and modify the ssl engine without reimplementing the existing methods.