FTP error, it is not clear why it gives me this error "(RuntimeException) java.lang.RuntimeException: 550 SSL / TLS required on the control channel"
connection example
help Thanks.
FTP:
Dim ftp As FTP
ftp.Initialize("FTP", "IP", 21, USER", "PASSWORD")
ftp.PassiveMode = True
If ftp.IsInitialized=True Then
Log("OK FTP!") '
End If
ftp.UploadFile (File.DirRootExternal, "Camera.png", False, "/Camera.png")
Hi,
This means that the server you are using supports only crypted (SSL/TLS) connection.
Usually you can set if it have to support plain text. What server are you using?
If you can't change the plain text setting try this:
B4x:
Dim ftp As FTP
dim ctm As CustomTrustManager
ctm.InitializeAcceptAll
ftp.Initialize("FTP", "IP", 21, USER", "PASSWORD")
ftp.PassiveMode = True
FTP.UseSSL = True
FTP.UseSSLExplicit = True
FTP.SetCustomSSLTrustManager(ctm)
If ftp.IsInitialized=True Then
Log("OK FTP!") '
End If
ftp.UploadFile (File.DirRootExternal, "Camera.png", False, "/Camera.png")
1. No need to check whether ftp.IsInitialized. It will always be after you called Initialize.
2. UseSSL and UseSSLExplicit are exclusive. Only set UseSSLExplicit to True.
3. It is a mistake to post code with CustomTrustManager without explaining what it does. It has security implications. Start without it. It is only needed if you are connecting to a server with a self signed certificate.
1. No need to check whether ftp.IsInitialized. It will always be after you called Initialize.
2. UseSSL and UseSSLExplicit are exclusive. Only set UseSSLExplicit to True.
3. It is a mistake to post code with CustomTrustManager without explaining what it does. It has security implications. Start without it. It is only needed if you are connecting to a server with a self signed certificate.
Hi Erel you are right, as he is sending camera's pictures to the ftp server, I assumed that he was using an internal server with self signed certificate, but it's not sure and in any case someone else can use the same code for other scope.
So, use ctm.InitializeAcceptAll only if the server hasn't a valid certificate and you know that it's a reliable server.
Thanks for your reply, but the error persists "android.system.ErrnoException: open failed: ENOENT (No such file or directory)", I don't understand why it tells me that it doesn't find any files or directories.
thank you
#If B4A
Dim rp As RuntimePermissions
'PERMISSION_ACCESS_FINE_LOCATION -------------------------------------
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
rp.CheckAndRequest(rp.PERMISSION_READ_EXTERNAL_STORAGE)
Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean)
If Result = False Then
MsgboxAsync("Autorizzazione non autorizzzate", "Attenzione...")
Return
End If
#End If
So, if I understood,are you using Filezilla server on Linux using WineHQ or something similar? Because I think that Filezilla server isn't native under linux.
In any case the error you are experiencing with, is related to a wrong setting of the user's directory server side.
Could you try to use filezilla as client (also locally) with same user and password for checking if the error is the same? In this way you can check if the problem is server side or client side.
Recently I had the similar problem with vsftpd under linux and the reported error was the same, but the home directory was correctly set and I solved it changing the control port with another than 21. Apparently it had nothing to do with it and with netstat I saw that none was using the 21 port, but It worked.
No, I'm using Filezilla under windows as a client to connect to the Linux server, I have a third party host / server, its host or server directory and "/" so I don't understand why it can't find the directory or file to upload and save it on my smartphone. Thank you for your time
Could it be that your hosting provider doesn't like "/" (root) as the folder on your presumably shared server?
Anyway I find your post #12 a bit confusing; are you uploading from device to server or downloading from server to your device?
"..I have a third party host / server, its host or server directory and "/" so I don't understand why it can't find the directory or file toupload and save it on my smartphone. "