-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support for OpenSslEngine with no finalizer #1695
base: main
Are you sure you want to change the base?
Conversation
Motivation: Custom SslContext should be retained on init. Modification: Retain custom SslContext. Result: Externally managed SslContext refcount is managed correctly.
Follow up for #1669 @normanmaurer ptal |
Why? In this case, SslContext is provided by the user so he has control over ref count. Moreover, isn’t it created with a refcount of 1? |
@slandelle yep but then it is decreased in destroy. point is user should know if they haven't cleaned up any resources, so in the case we are dealing with an SslContext provided by the user, refcount will be incremented to 2, then decremented back to 1 once destroy is invoked on the SslEngineFactory. |
I don't think the test failures are related..
|
The other possible solution is something like this.. https://gist.github.com/johnou/4c699909ef9be3c030eaee29432c1ce3#file-defaultsslenginefactory-java-L34 |
6ea11f4
to
f8fab66
Compare
Motivation:
Custom SslContext should be retained on init.
Modification:
Retain custom SslContext.
Result:
Externally managed SslContext refcount is managed correctly.