Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web Sockets package does not work with SSL. #19

Open
domenipavec opened this issue Aug 13, 2014 · 4 comments
Open

Web Sockets package does not work with SSL. #19

domenipavec opened this issue Aug 13, 2014 · 4 comments
Milestone

Comments

@domenipavec
Copy link
Contributor

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.
@edsiper
Copy link
Member

edsiper commented Aug 13, 2014

please copy/paste your plugins.load

@edsiper edsiper added this to the DST-2 milestone Sep 25, 2014
@edsiper
Copy link
Member

edsiper commented Jul 4, 2015

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'.

@mr-mop
Copy link

mr-mop commented May 2, 2018

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?

@mr-mop
Copy link

mr-mop commented May 16, 2018

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.

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

No branches or pull requests

3 participants