Web Sockets package does not work with SSL.
To reproduce the problem:
- compile wschat example with SSL
- change javascript to connect to wss://...
- open 2 tabs of chat and write a message
Output I get:
Monkey HTTP Daemon 1.4.0
Built : Aug 13 2014 22:11:35 (gcc 4.6.3)
Home : http://monkey-project.com
[2014/08/13 22:43:10] [ Info] Linux TCP_FASTOPEN enabled.
* Process ID is 9438
* Server socket listening on Port 2001
* 1 threads, 508 client connections per thread, total 508
* Transport layer by polarssl in https mode
[2014/08/13 22:43:10] [ Info] Duda: loading service 'wschat'
[2014/08/13 22:43:10] [ Info] HTTP Server started
[FD 16] WebSockets Connection Upgrade
[FD 16] WebSockets Upgrade to 'websocket'
[FD 14] WebSockets Connection Upgrade
[FD 14] WebSockets Upgrade to 'websocket'
monkey: polarssl.c:587: context_new: Assertion `cur != ((void *)0)' failed.
please copy/paste your plugins.load
note: upgrading to Monkey v1.6 this will not longer be an issue as the network I/O operations and Streams are handled directly by the monkey run time, duda will not longer issue a direct 'write'.
Which version exactly are you saying works with this?
Which of the build processes should I use?
The recommended approach is using Dudac and dst-1, but that is Monkey 1.4 Are you saying modify dudac to checkout 1.6 instead of dst-1? Have you tried this?
OK having dug into this a little, the problem seems to be in the broadcast worker thread of the websocket package of Duda. The ws_broadcast_worker() will make a direct call to ws_write() but when it gets as far as sending over an SSL/TLS socket, the broadcast worker thread has no TLS context, so is unable to access the local_context pthread key.
I'm not exactly sure how to resolve this at the moment, but thought I'd share the info in case its useful.
If I find anything more, I'll update this.