SSL Web Server support

  • File locations discussed on the Kodi wiki map to:

    /storage/.kodi/userdata/server.key

    /storage/.kodi/userdata/server.pem

    I've no idea if anything else is needed.. but we haven't done anything to disable the feature.

  • According this commit I think that web server have to support MHD_FEATURE_SSL. Maybe libmicrohttpd version is too old. First version of libmicrohttpd which supports MHD_FEATURE_SSL is 0.9.35

    Edited once, last by lbochen (February 19, 2019 at 9:48 PM).

  • I found something in package.mk for libmicrohttpd in LibreELEC project:

    Code
    ...
    PKG_CONFIGURE_OPTS_TARGET="--disable-shared \
                               --enable-static \
                               --disable-curl \
                               --disable-https \
                               --with-libgcrypt-prefix=$SYSROOT_PREFIX/usr"
    ..

    Maybe --disable-https option is a reason

  • aptalca yes a reverse proxy could solve this, but it would be a lot easier if we could use the build in SSL feature of Kodi. That way we don't have to set up a separate reverse proxy server to accomplish this.

    The --disable-https option to configure the libmicrohttpd package in LibreELEC is probably the root cause. Any reason why this is included? Can't it be removed?

  • Hi guys!

    Any progress here? I tried to run the kodi webserver with SSL enabled today - but with no success.

    I think this really might be a reasonable requirement. And since the kodi people already invested their time to make this work from their side it would be great if this worked also in LibreELEC :-).

  • Yeah, I tried. I created the key & cert pair and stored it under

    /storage/.kodi/userdata/server.key

    /storage/.kodi/userdata/server.pem

    An then I just enabled the SLL under Settings -> Services:

    Then http started to be redirected to https, however connection was refused there. And this last line from the crash log (/storage/.kodi/temp/kodi_*_20230626165241.log) seems to be the immediate cause:

    Code
    FATAL <libmicrohttpd>: serious error: reason "MHD_stop_daemon() was called twice." in file "/build/build.LibreELEC-RPi4.arm-10.0.4/build/libmicrohttpd-0.9.72/src/microhttpd/daemon.c" at line 7328

    Anyway, nice it works for you - then there really could be just problem on my side. I'm not using the newest libreelec/kodi version (as it's obvious from the log message) so I will give it a try. Thank you for your response!