Is it possible to connect to CoreElec / Kodi with an FTP server using TLS encryption.
The server is set up on linux with the VSFTPD program. In Filezilla the connection works … but in CE / Kodi / option add video source / ftp …, despite many attempts, it does not detect the connection.
The port is specific and is redirected to the CE box on the router.
I have no experience with connecting outside the local LAN. Maybe there is another well-working and proven method of connecting to the server where I have audio video files?
ps. I think I found a program for this: WireGuard …
but the setup is tricky
I’m starting to combine settings with WireGuard
but the server is on a fairly weak HC1 hardware (arm) and I think I have to deal with installing a new kernel / wireguard (the operating system is Armbian)
I found interesting entries
I changed data like IP address / port number etc.
FileZilla displays a certificate validation window on the first connection to the server, etc.
… but in CoreElec there is no such possibility, it is not an OS
I also found such info:
VSFTPD can only allow user to login from clients that support encryption services
The command line does not offer encryption services thus producing the error. So, to securely connect to the server, we need a FTP client that supports SSL/TLS connections such as FileZilla .
I found this topic before and despite adding this post
auth = TLS … unable to connect
but there is already some effect that the CE system is trying to establish a connection.
log info
2022-11-01 09:39:46.252 T:11998 DEBUG <general>: Curl::Debug - TEXT: TLSv1.3 (OUT), TLS alert, unknown CA (560):
2022-11-01 09:39:46.252 T:11998 DEBUG <general>: Curl::Debug - SSL_DATA_OUT: 0
2022-11-01 09:39:46.252 T:11998 DEBUG <general>: Curl::Debug - TEXT: SSL certificate problem: self signed certificate
2022-11-01 09:39:46.252 T:11998 DEBUG <general>: Curl::Debug - TEXT: Closing connection 0
2022-11-01 09:39:46.256 T:11998 ERROR <general>: CCurlFile::Exists - Failed: SSL peer certificate or SSH remote key was not OK(60) for ftp://USERNAME:PASSWORD@x.x.x.x:x2455/media/filmy/|auth=TLS
2022-11-01 09:39:46.256 T:11998 WARNING <general>: Process directory 'ftp://USERNAME:PASSWORD@X.X.X.X:x2455/media/filmy/|auth=TLS' does not exist - skipping scan.
black magic … maybe the settings in vsftpd.conf? … the server was created for virtual users according to this tutorial (sory but in Polish) https://ubuntu.pl/forum/viewtopic.php?f=150&t=184275
because the login is not the name of Kris … it is only the data entered in the certificate, such as: province / city / email / name: Kris etc.
ps. now I’m “fighting” with WireGuard …FTP (vsftpd) / TLS does not work on CE
I already tried it, ie I removed the old vsftpd.pem
I created a new one with the command: sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /etc/ssl/private/vsftpd.pem -out /etc/ssl/private/vsftpd.pem
I changed the entries:
CN = kris … on IP adress / hostname … and when logging in to FileZilla for the first time, there were no errors and red entries when verifying the certificate.
But it did not do anything when connecting FTP (vsftpd) to CE … once I managed to connect and check the login and password and approve them … but it was not possible to list directories with audio video files again … .upssss.
You can endlessly test this way without success … something is wrong with FTP server VSFTPD / CE / TLS
my configuration that works fine on FileZilla (/etc/vsftpd.conf)
EUREKA !!! … thanks @vpeter for your patience!
I managed … but it helped to generate a new certificate (without errors, the so-called red entries when logging in to FileZilla) I also copied the file: /etc/ssl/private/vsftpd.pem from the vsftpd server to CE path: /storage/.config (but whether did it matter?)
However, it was very important to enter the path to the FTP server resources! I always typed: /media/filmy because that was how it was set for a given virtual user. And you only had to enter: /|auth=TLS
and the path showed automatically! (from ftp server settings) maybe it will be useful to someone
@vpeter I have a request to remove an IP address from descriptions
SSL: certificate subject name ‘kris’ does not match target host name ‘X.X.X.X’
thanks
Ps.
I checked to be sure and for correct operation / connection of CE with vsftpd / TLS server, in addition to the correct entries as above.
server certificate file is required: vsftpd.pem … but you need to rename it to: cacert.pem and put it in the path
/storage/.config
a CE reboot is also required! … thanks again @vpeter I wouldn’t have made that up
If you have just one certificate file to add it can be just renamed. But to add yet another certificate you need to copy/paste the content to this file.