@@ -65,6 +65,9 @@ public class WolfSSLSession {
6565 private WolfSSLIORecvCallback internRecvSSLCb ;
6666 private WolfSSLIOSendCallback internSendSSLCb ;
6767
68+ /* have session tickets been enabled for this session? */
69+ private boolean sessionTicketsEnabled = true ;
70+
6871 /* is this context active, or has it been freed? */
6972 private boolean active = false ;
7073
@@ -2720,10 +2723,33 @@ public int useSNI(byte type, byte[] data) throws IllegalStateException {
27202723 */
27212724 public int useSessionTicket () throws IllegalStateException {
27222725
2726+ int ret ;
2727+
2728+ if (this .active == false )
2729+ throw new IllegalStateException ("Object has been freed" );
2730+
2731+ ret = useSessionTicket (getSessionPtr ());
2732+ if (ret == WolfSSL .SSL_SUCCESS ) {
2733+ this .sessionTicketsEnabled = true ;
2734+ }
2735+
2736+ return ret ;
2737+ }
2738+
2739+ /**
2740+ * Determine if session tickets have been enabled for this session.
2741+ * Session tickets can be enabled for this session by calling
2742+ * WolfSSLSession.useSessionTicket().
2743+ *
2744+ * @return true if enabled, otherwise false.
2745+ * @throws IllegalStateException WolfSSLSession has been freed
2746+ */
2747+ public boolean sessionTicketsEnabled () throws IllegalStateException {
2748+
27232749 if (this .active == false )
27242750 throw new IllegalStateException ("Object has been freed" );
27252751
2726- return useSessionTicket ( getSessionPtr ()) ;
2752+ return this . sessionTicketsEnabled ;
27272753 }
27282754
27292755 /**
0 commit comments