/// <summary> /// Set the function to use for PSK connections /// </summary> /// <param name="ctx">pointer to CTX that the function is set in</param> /// <param name="psk_cb">PSK function to use</param> public static void CTX_set_psk_client_callback(IntPtr ctx, psk_client_delegate psk_cb) { try { GCHandle gch = GCHandle.FromIntPtr(ctx); ctx_handles handles = (ctx_handles)gch.Target; handles.set_psk(GCHandle.Alloc(psk_cb)); wolfSSL_CTX_set_psk_client_callback(handles.get_ctx(), psk_cb); } catch (Exception e) { log(ERROR_LOG, "wolfssl psk client callback error " + e.ToString()); } }
private static extern void wolfSSL_CTX_set_psk_client_callback(IntPtr ctx, psk_client_delegate psk_cb);