[Libwebsockets] v2.0 crashes

Andrejs Hanins andrejs.hanins at ubnt.com
Thu May 12 10:38:05 CEST 2016


Hi,

    Just updated to v2.0 and got crashes. The first one I figured out myself - it was necessary to add LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT option to ctx. Not sure whether it supposed to crash without this option...

   But the second one is more tricky - I get NULL context in lws_ssl_server_name_cb from SSL_CTX_get_ex_data. Any ideas? FYI - I create two lws contexts inside the process - one for server and one for client. Before v2.0 everything worked rock solid.

   My compile options are:

CMAKE_OPTIONS += -DLWS_WITHOUT_TESTAPPS=ON
CMAKE_OPTIONS += -DCMAKE_BUILD_TYPE=DEBUG
CMAKE_OPTIONS += -DLWS_WITHOUT_EXTENSIONS=ON
CMAKE_OPTIONS += -DLWS_MAX_SMP=1
CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs
CMAKE_OPTIONS += -DLWS_OPENSSL_SUPPORT=ON
CMAKE_OPTIONS += -DLWS_WITH_SSL=ON

BR, Andrey

On 05/05/2016 05:20 AM, Andy Green wrote:
> Hi -
>
> Libwebsockets v2.0 is out.
>
> The site is updated
>
> https://libwebsockets.org/
>
> as is the page about v2.0 new features
>
> https://libwebsockets.org/lws-2.0-new-features.html
>
> and the changelog
>
> https://github.com/warmcat/libwebsockets/blob/v2.0-stable/changelog
>
> I replaced apache for my web services some weeks ago and have been using lwsws (the new generic webserver wrapper on lws) instead, you can see the new server status page here
>
> https://libwebsockets.org/server-status/
>
> This is an included lws protocol plugin, although you would probably want to put it on a vhost mapped to localhost interface only.
>
>
> Basically the theme of the release is eliminate server boilerplate code and use plugins for ws protocols.  With this method, the test server is reduced to one short file with no protocols or user callback.
>
> https://github.com/warmcat/libwebsockets/blob/v2.0-stable/test-server/test-server-v2.0.c
>
> If you use lwsws, the generic webserver wrapper which uses JSON config files, you can even eliminate the above code as well.
>
> https://github.com/warmcat/libwebsockets/blob/v2.0-stable/README.lwsws.md
>
> Protocol plugins can be be easily built against lws out-of-tree
>
> https://github.com/warmcat/libwebsockets/tree/v2.0-stable/plugin-standalone
>
> and distributed in their own directories, lws scans in a given list of directories for them at startup (and for lwsws, that list is gleaned from JSON config fragments in a conf.d/)
>
> In addition to passing the usual Travis + Appveyor it's checked on Coverity today and is zero defects.
>
> https://scan.coverity.com/projects/warmcat-libwebsockets
>
> Branch v2.0-stable is also set up for the usual ongoing fixes while development continues on master.
>
> Enjoy!
>
> -Andy
> _______________________________________________
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
> http://libwebsockets.org/mailman/listinfo/libwebsockets




More information about the Libwebsockets mailing list