[Libwebsockets] R: vhost default: no cert

Andy Green andy at warmcat.com
Fri Feb 15 13:05:50 CET 2019



On February 15, 2019 7:54:20 PM GMT+08:00, Stefano Mora <stefano.mora at newdep.com> wrote:
>Thanks,
>do you mean that I need to recompile the library with DEBUG options?

No... I mean the log is too "noisy" as notice.  I already changed it to something less  visible in master.

>I can confirm that the current lib doesn't contains any certificate:
>the program does not use wss or https.

It's just noting that.  It doesn't indicate any error or problem.

>When the error happens the client browser shows a blank page until the
>user press F5 to reload the page (and the ws connection).

Whatever that is, has nothing to do with that log message.

Is the problem coming with the original minimal example?

Enable the js debug console on your browser and see if that feels something bad happened.  If no clue there, use your browser developer panel to log and time network events that happen while loading the page.

And look at verbose lws logs as described below.

>Other question:
>Even if I'm using for the most the 'websocket side', I'd like to access
>time to time to a simple web page.
>I left the original configuration:
>static const struct lws_http_mount mount = {
>	/* .mount_next */		NULL,		/* linked-list "next" */
>	/* .mountpoint */		"/",		/* mountpoint URL */
>	/* .origin */			"./mount-origin",  /* serve from dir */
>	/* .def */			"index.html",	/* default filename */
>	/* .protocol */			NULL,
>	/* .cgienv */			NULL,
>	/* .extra_mimetypes */	NULL,
>	/* .interpret */		NULL,
>	/* .cgi_timeout */		0,
>	/* .cache_max_age */	0,
>	/* .auth_mask */		0,
>	/* .cache_reusable */		0,
>	/* .cache_revalidate */		0,
>	/* .cache_intermediaries */	0,
>	/* .origin_protocol */		LWSMPRO_FILE,	/* files in a dir */
>	/* .mountpoint_len */		1,		/* char count */
>	/* .basic_auth_login_file */	NULL,
>};
>I put the server in a folder; I created in the same folder the
>mount-origin dir and put on that the index.html file.
>If I point the browser on the 'IP:7681' I always receive a page
>containing a large '404'.
>Where is my error ??

To keep them self-contained and easy to understand, the minimal examples put all their assets in the example's dir.  For that reason the mount dir is defined with a path relative to the cwd, eg "./mount-origin".  But for a real app, you probably want to put your stuff in /usr/local/share or whatever.  In that case the mount should point to it using an absolute path, so you can run the app from any dir.

If that's not it, also there will be logs about that 404.  Increase the log verbosity and build lws with cmake .. -DCMAKE_BUILD_TYPE=DEBUG

-Andy

>
>-----Messaggio originale-----
>Da: Andy Green <andy at warmcat.com> 
>Inviato: mercoledì 13 febbraio 2019 16:30
>A: Stefano Mora <stefano.mora at newdep.com>;
>libwebsockets at ml.libwebsockets.org
>Oggetto: Re: [Libwebsockets] vhost default: no cert
>
>
>
>On 13/02/2019 04:27, Stefano Mora wrote:
>> Hi all,
>> 
>> sometime happens that I found this text on log file (where I redirect
>
>> all the lwsl_user() outputs) and apparently the server is down:
>> 
>> vhost default: no cert
>> 
>> Please, what does it mean?
>
>Lws checks the expiry date on certs on all vhosts daily...
>
>https://libwebsockets.org/git/libwebsockets/tree/lib/tls/tls-network.c#n77-92
>
>... it's just noting there's no cert associated with the vhost
>'default'.  Probably that's better as a debug or info log for that
>case.
>
>-Andy
>
>> ---
>> 
>> Stefano Mora / SW Engineer
>> stefano.mora at newdep.com <mailto:stefano.mora at newdep.com>
>> 
>> *NEWDEP S.r.l.* - SOFTWARE & ENGINEERING SERVICES
>> 
>> 
>> _______________________________________________
>> Libwebsockets mailing list
>> Libwebsockets at ml.libwebsockets.org
>> https://libwebsockets.org/mailman/listinfo/libwebsockets
>> 


More information about the Libwebsockets mailing list