On 05/07/2017 09:20 PM, Nicolas Mora wrote: > Hello, > > I'm still working on a websocket implementation based on MHD, the non > secure websocket works fine, but the secure websocket doesn't work yet. > > I'm having problems with the socket and the tls session. I get my > inspiration from the test_upgrade.c file but I can't have a valid tls > session anyway. > > Inside the upgrade callback function, I use the same sequence as in the > example program to initiate the tls session and the result tells me it's > connected: > https://github.com/babelouest/ulfius/blob/2.0/src/u_websocket.c#L127 > > But when it comes to reading or sending data, I got nothing or errors, > whether the socket is in blocking mode or not. > > The read/write functions are at the end of the file: > https://github.com/babelouest/ulfius/blob/2.0/src/u_websocket.c#L720 > > Does anyone see what's wrong with my code?
Eh, what is wrong is that you use "gnutls_record_send". MHD will do this for you, you should just use "send/recv", even in HTTPS mode! In fact, your code (short of MHD_start_daemon) can be exactly the same for HTTP and HTTPS.
signature.asc
Description: OpenPGP digital signature
