SFTP broken in LE12

  • Hello!

    Seems that FTPs connectivity (with TLS) is broken in LE12 as i found.

    I've used LE 11.0.6 on 4 different devices (Raspberry 2-3-4-5) where i was able to connect to an FTP server with TLS authentication (FTPS). I upgraded / clean installed LE 12.0.0 where the same source gives me empty folder.

    I have had this in sources.xml on both versions, i replaced username and password and server URL here:

    Code
            <source>
                <name>FTPs</name>
                <path pathversion="1">ftp://username:password@servername:customport/folder/|auth=TLS&verifypeer=false</path>
                <allowsharing>true</allowsharing>
            </source>


    Here is my log from LE 12.0.0 during attempt to enter in this source. Debug log was enabled in KODI. I've replaced my server details here again:


    I've downgraded one of my machines from 12.0.0 and FTPs started to work as expected in 11.0.6. Then upgraded again to 12.0.0 and it stopped working. Definitely something wrong in 12.0.0

    Here is the log from LE 11.0.6 which works fine. I replaced servername and port here again, notice that USERNAME AND PASSWORD are not in the log, those were replaced to these CAPITAL words by KODI, not by me.

    ALSO PLEASE NOTICE, THAT THE /FOLDER AFTER THE SERVERNAME EXISTS HERE, WHILE IN ABOVE NON-WORKING SCENARIO ON 12.0.0 THE FOLDER IS MISSING AFTER THE SERVERNAME:PORT !! THIS WAS THE DIFFERENCE I COULD OBSERVE HERE IN THE LOGS.


    Any clue what's going on in LE 12.0.0 ?

    Thanks so much ! ;)

  • TLS provides encryption and not authentication. You are probably connecting to regular FTP service with StartTLS support and not to FTPS (or FTP-over-SSL)

  • I haven't talked about SFTP, i was hoping to have been clear.

    This is FTPS also known as FTP over TLS/SSL.

    I'm not using any FTP service on LE, as i want to connect to one and not hosting one. In this sense, i'm FTP client.

    All this above has worked in LE 9, 10, 11 from stock. Broken in LE 12.

  • chewitt Thanks for these links. Very interesting indeed. I was expecting an OS component here that could have been the root cause, but seems its rather KODI related indeed. Not sure how Android and LE shares versions of certain linux components that could be the cause. Anyway, this is a NO GO for me to use LE12, as i'm relying on FTPS to access my NAS from different places. I'll just skip LE12 for now and use LE11. Hoping there will be an update eventually on KODI and/or LE12.

  • Hi guys, I can confirm that the problem exists - tested on a self-built .ova image based on latest 21.1 kodi (commit 7938029863608416aaf85ee1dd2bb9cb84dc6d7b from LE repo).

    I was able to fix the issue by upgrading the curl package to the latest version - 8.9.1 (previously was 8.6.0). Versions 8.7+ have some fixes related to FTP - https://curl.se/changes.html

  • It works on LibreELEC-Generic.x86_64-12.0-nightly-20230309-5426f16.img.gz.

    You need to enable component logging in Kodi and select libcURL as component. This will show you much more information in log file to compare.

  • There is a comparison table that indicates which versions of curl, along with their libraries, are used in the different LibreELEC versions. It is evident that under LibreELEC 12.0.1, 12.0.2, and the current nightly-20250415-e25b5e0 (v12.x), ftps does not function.

    LibreELEC Generic.x86_64 and RPi2.arm curl comparison table:
    183

    With the current LibreELEC nightly-20250424-067110d (v13.x), ftps is operational again; however, various elements (folders/files) are constantly being omitted. This renders it completely unusable!

    Examples pictures for missing Elements (Folder or Files):
    missing-elements-Libre-ELEC-nightly-13-x-1.jpg
    missing-elements-Libre-ELEC-nightly-13-x-2.jpg
    missing-elements-Libre-ELEC-nightly-13-x-3.jpg

    My questions are as follows:

    - Why is the nightly version (v12.x) still unfixed? The included curl version has been outdated for a year.
    - Why are the folders/files not fully listed in the nightly version (v13.x)?

  • For me, this FTPS issue is quite new. It illustrates how long I have not used it, even though it has been set up in each of my LibreELEC installations for years. A downgrade to LibreELEC 11.0.6 is not an option for me, nor are the latest nightlies of v13, as in this case, FTPS incorrectly lists elements (folders/files).


    Through a valuable tip from another post by vpeter on how to overlay files in the file system, I have found a provisional solution. I extracted the files curl and libcurl.so.4.8.0 from the LibreELEC 11.0.6 images (Gen eric.x86_64|RPi2.arm). The two required files are hidden within the archive in the SYSTEM file, located in the directory structures /usr/bin/curl and /usr/lib/libcurl.so.4.8.0. For Windows users, extracting works well with the PeaZip free archiver utility, as the SYSTEM file is also gz compressed.
    Once the two files are available, it is time to copy them to your current LibreELEC installation. For this purpose, SSH must be enabled on LibreELEC.


    Default access for ssh/sftp:
    ssh root@<LibreELEC-IP>
    user: root
    pass: libreelec

    Via SFTP, the two required files are copied to the /storage/ directory. For Windows users, the tool WinSCP is recommended, but the display of hidden files must be enabled beforehand; otherwise, you will not be able to see the hidden .config directory. The file autostart.sh in /storage/.config/autostart.sh is added with the two commands listed below. Ensure that the file attributes for both files for fully functionallty are set back to rwxr-xr-x. Then reboot the media center, and FTPS should function again.


    autostart.sh
    #!/bin/sh -e
    # curl and libcurl.so.4.8.0 extracted from LibreELEC 11.0.6
    mount -o bind /storage/libcurl.so.4.8.0 /usr/lib/libcurl.so.4.8.0
    mount -o bind /storage/curl /usr/bin/curl
    exit 0


    This is approximately what the contents of the /storage/ directory look like:



    For those who do not want to experience any headaches or wish to avoid the entire process of extraction, I am offering these two files. This is of course a matter of trust. libcurl.so.4.8.0 and curl.zip