Why websockets.c example of libonion gives error "Cant calculate SHA1 if gnutls is not compiled in!" -
i trying run websockets.c example of libonion (https://github.com/davidmoreno/onion/tree/master/examples/websockets). however, when run it, gives error.
"[error codecs.c:389] cant calculate sha1 if gnutls not compiled in! aborting now"
the other examples running fine.
i'm compiling :
$ gcc -o muz websockets.c -i$onion_dir/src/ -l$onion_dir/src/onion/ -lonion_static -lpam -lgnutls -lgcrypt -lpthread
the terminal output given below.
[49cdc700] [2017-08-21 11:26:12] [debug onion.c:216] ignoring sigpipe [49cdc700] [2017-08-21 11:26:12] [debug poller.c:328] init thread stuff poll. eventfd @ 4 [49cdc700] [2017-08-21 11:26:12] [debug poller.c:328] init thread stuff poll. eventfd @ 4 [49cdc700] [2017-08-21 11:26:12] [debug onion.c:649] add 0x136a400 listen_point (0x136a470, 0x136a400, (nil)) [49cdc700] [2017-08-21 11:26:12] [debug onion.c:461] created default http listen port [49cdc700] [2017-08-21 11:26:12] [debug listen_point.c:192] trying listen @ (null):8080 [49cdc700] [2017-08-21 11:26:12] [debug listen_point.c:233] listening 0.0.0.0:8080, fd 6 [49cdc700] [2017-08-21 11:26:12] [debug onion.c:507] adding listen point fd 6 poller [49cdc700] [2017-08-21 11:26:12] [debug onion.c:515] start polling / listening 0x136a470, 0x136a400, (nil) [494f1700] [2017-08-21 11:26:12] [debug poller.c:497] start polling [48cf0700] [2017-08-21 11:26:12] [debug poller.c:497] start polling [474ed700] [2017-08-21 11:26:12] [debug poller.c:497] start polling [47cee700] [2017-08-21 11:26:12] [debug poller.c:497] start polling [484ef700] [2017-08-21 11:26:12] [debug poller.c:497] start polling [46cec700] [2017-08-21 11:26:12] [debug poller.c:497] start polling [49cdc700] [2017-08-21 11:26:12] [debug poller.c:497] start polling [464eb700] [2017-08-21 11:26:12] [debug poller.c:497] start polling [464eb700] [2017-08-21 11:26:26] [debug response.c:104] recalculating date header [464eb700] [2017-08-21 11:26:26] [info response.c:189] [127.0.0.1] "get /" 200 501 (keep-alive) [464eb700] [2017-08-21 11:26:26] [debug websocket.c:88] websockets! [464eb700] [2017-08-21 11:26:26] [error codecs.c:389] cant calculate sha1 if gnutls not compiled in! aborting
there should no need compile example separately, should automatically compiled along entire project. example if in main package directory, create clean directory , run cmake it:
mkdir build && cd build cmake .. then through output of cmake , make sure 3rd party libraries , other dependencies found. gnutls should following:
-- found gnutls: /usr/lib/libgnutls.so (found version "3.5.13") -- found gcrypt: /usr/include (found version "1.7.7") -- ssl support compiled in. if instead error message like:
gnutls or gcrypt not found. ssl support not compiled in. , must make sure libgnutls.so installed , can found in default search paths (/usr/lib/ example).
after fix cmake errors , run make, should find example in examples/websockets/websockets.
Comments
Post a Comment