Has anyone been able to get FTPS (FTP with SSL) to work?
I can confirm it works with our FTP server (Ubuntu 12.04 with vsftpd) with the following clients:
When running Debug (rapid) or Release I just get the "Error" MsgBox (see code below). When running Debug (legacy) I get a Java error: "java.lang.Exception: Sub libftp_listcompleted signature does not match expected signature."
I have tested with a direct internet connection and via a correctly configured firewall.
I use the following test code. The only option I have is .UseSSL and the port number in the .Initialize call. I can't select implicit or explicit. I've tried setting .UseSSL before and after .Initialize.
When we enable dual SSL and non-SSL modes on the FTP server then the code runs.
Can anybody help me please?
I can confirm it works with our FTP server (Ubuntu 12.04 with vsftpd) with the following clients:
- FileZilla Client - configured "Explicit FTP over TLS"
- VB6 and the Chilkat FTP2 ActiveX - configured ".AuthTls = 1" (AUTH SSL) & ".Ssl = 0" (not using implicit SSL connection)
- ES File Explorer on the same Android device as my B4A app - configured "encryption" = "explicit"
When running Debug (rapid) or Release I just get the "Error" MsgBox (see code below). When running Debug (legacy) I get a Java error: "java.lang.Exception: Sub libftp_listcompleted signature does not match expected signature."
I have tested with a direct internet connection and via a correctly configured firewall.
I use the following test code. The only option I have is .UseSSL and the port number in the .Initialize call. I can't select implicit or explicit. I've tried setting .UseSSL before and after .Initialize.
When we enable dual SSL and non-SSL modes on the FTP server then the code runs.
Can anybody help me please?
B4X:
Sub Process_Globals
Dim libFTP As FTP
Dim libContinueTimer As Timer
Dim lCurrentState As Long
Dim conStateIdle As Long
Dim conStateConnecting As Long
Dim conStateConnected As Long
conStateIdle = 0
conStateConnecting = 1
conStateConnected = 2
End Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
lCurrentState = conStateIdle
libContinueTimer.Initialize("libContinueTimer", 1)
libContinueTimer.Interval = 1
libContinueTimer.Enabled = True
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub libContinueTimer_Tick
libContinueTimer.Enabled = False
Select Case lCurrentState
Case conStateIdle
lCurrentState = conStateConnecting
libFTP.Initialize("libFTP", "xxx", 21, "xxx", "xxx")
libFTP.UseSSL = True
libFTP.PassiveMode = True
libContinueTimer.Enabled = True
Case conStateConnecting
libFTP.List("/")
Case conStateConnected
Msgbox("Ok", "FTPS")
ExitApplication
End Select
End Sub
Sub libFTP_ListCompleted(ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry)
Dim lIndex As Long
Dim lFileCount As Long
If Success Then
lFileCount = Files.Length
For lIndex = 0 To lFileCount - 1
Log(Files(lIndex).Name)
Next
lCurrentState = conStateConnected
libContinueTimer.Enabled = True
Else
Msgbox("Error", "FTPS")
ExitApplication
End If
End Sub