Skip to content

Check TLS 1.3 session for ticket before saving to Java cache#175

Merged
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
cconlon:getSessionCheckForTicket
Feb 13, 2024
Merged

Check TLS 1.3 session for ticket before saving to Java cache#175
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
cconlon:getSessionCheckForTicket

Conversation

@cconlon
Copy link
Copy Markdown
Member

@cconlon cconlon commented Feb 13, 2024

This PR makes one change in native JNI code when getting and returning the native WOLFSSL_SESSION object to be stored into the Java session cache.

If the connection is using TLS 1.3, only return and store the session if we have the ticket. Otherwise, we may return an incomplete session object which may cause subsequent resumption attempts to fail.

This issue shows up in our ant tests when native wolfSSL is configured with:

cd wolfssl
./autogen.sh
./configure --enable-jni --enable-all

cd wolfssljni
./java.sh
ant
ant test

cat build/reports/TEST-com.wolfssl.provider.jsse.test.WolfSSLJSSETestSuite.txt

...
Testcase: testReuseSession took 0.012 sec
	FAILED
failed to create engine
junit.framework.AssertionFailedError: failed to create engine
	at com.wolfssl.provider.jsse.test.WolfSSLEngineTest.testReuseSession(WolfSSLEngineTest.java:539)
...

@JacobBarthelmeh JacobBarthelmeh merged commit 424d4c0 into wolfSSL:master Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants