Always call wolfSSL_get1_session() inside native JNI WolfSSLSession.getSession() #236
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Java callers of
WolfSSLSession.getSession()
should always expect to free the returned session pointer withWolfSSLSession.freeSession(long session)
. PreviouslygetSession()
calledwolfSSL_SESSION_dup()
but only for connections that were not TLS 1.3 or had a session ticket. CallingwolfSSL_get1_session()
should be a more consistent solution since it increases the ref count on the WOLFSSL_SESSION in question.This should make it more interoperable with various build options - TLS 1.3, without TLS 1.3, with
-DNO_SESSION_CACHE_REF
.This also adds one GitHub Action test for the wolfSSL configure
--enable-jni CFLAGS=-DNO_SESSION_CACHE_REF
.Potential fix for ZD 17211.