View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0004944||libmicrohttpd||documentation||public||2017-03-08 00:05||2020-11-14 12:23|
|Reporter||Christian Grothoff||Assigned To|
|Platform||i7||OS||Debian GNU/Linux||OS Version||squeeze|
|Product Version||Git master|
|Summary||0004944: tutorial should cover HTTP Upgrade API|
|Description||We should show a stripped-down example for how to use the upgrade API.|
|Tags||No tags attached.|
||Could we close this Issue?|
||Eh, no, there is AFAIK nothing in doc/libmicrohttpd-tutorial.texi about upgrade yet.|
Hello! Was trying to do just this. Or at least I think so (Upgrade HTTP to HTTPS).
Don't think I nailed it because if I activate MHD_USE_TLS I can't receive HTTP connections (Errors with Handshake out of context)...and if I take it away—I get the following complaints:
MHD HTTPS option 8 passed to MHD but MHD_USE_TLS not set.
MHD HTTPS option 9 passed to MHD but MHD_USE_TLS not set.
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to localhost:8080
Would love some help!
This issue is not about upgrading from http to https, but about the HTTP upgrade to another protocol (usually WebSockets) feature.
To 'upgrade' to HTTPS, all you need to do is
1) run 2 MHD daemons (so you must do MHD_start_daemon *twice*), and
2) Use a redirect (301/302) from the HTTP-daemon to the HTTPS address.