FTPS implementation is not secure tight

Post your questions and help other users.

Moderator: Martin

Post Reply
Sentinel
Posts: 3
Joined: 11 Apr 2018 00:03

FTPS implementation is not secure tight

Post by Sentinel » 11 Apr 2018 20:10

FTPS actions require FTP server to have disabled following options:
- Force PROT P to encrypt file transfers when using FTP over TLS
- Require TLS session resumption on data connection when using PROT P
These settings need to be enabled for file transfer to be secure.

When these option on server are enabled (which are as default for filezilla) uploaded files by automagic are empty or actions don't work at all (for example "connection closed by peer" error).

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: FTPS implementation is not secure tight

Post by Desmanto » 12 Apr 2018 17:27

I ever setup Filezilla FTP too and remember got the similar error. But the solution is shortlived, as I quickly found a better way to transfer file to my Windows.

Is FTP (specifically filezilla) a must? Or you are just looking for ways to automating transfer files from Phone to PC? If you don't mind the method, the better solution for me is using native SMB shared folder. Install MiXplorer (from xda) and use the intent broadcast to transfer the file. You can do it vice versa too, starting FTP at your phone. I have show the example here : viewtopic.php?f=4&t=7261 You can find the link to the SMB tutorial too. It takes some setup, but only once. Later you only need to change the destination path only. If you don't mind to configure the FTPS settings, I am sure the Start activity setting is also just another setup for you.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Sentinel
Posts: 3
Joined: 11 Apr 2018 00:03

Re: FTPS implementation is not secure tight

Post by Sentinel » 13 Apr 2018 15:31

With MiXplorer broadcast actions I don't have the direct ability to check within automagic if the file is successfully overwritten (without redownload and compare or reading the MiXplorer notification in a trigger).

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: FTPS implementation is not secure tight

Post by Desmanto » 13 Apr 2018 17:42

Oh, I forgot to state that this is still considered to be a bug and need to be resolved. I just give alternative meanwhile it is being fixed.

MiXplorer doesn't give feedback except the toast message. I thought of catching the notification using trigger notification on screen displayed, and then parse the message from MiXplorer. But most of usage will prompt me error if the files is not sent properly, so I put it aside. Let me check if there is other method we can use to crosscheck the transfer status (success or failed).
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: FTPS implementation is not secure tight

Post by Martin » 17 Apr 2018 17:20

Hi,

Did you try to set field Data Channel Protection to Private - P in the configuration of the FTP action? If yes, could you please activate the debug log in the settings of Automagic, execute the action one more time and then send the log by mail to me (menu->Manage->Log, menu->Send Log)

Regards,
Matrin

Sentinel
Posts: 3
Joined: 11 Apr 2018 00:03

Re: FTPS implementation is not secure tight

Post by Sentinel » 19 Apr 2018 22:43

I always use the data channel protection "Private - P".
Sample log:

Code: Select all

20.04.2018 00:32:06.032 [FTPS Example] Starting to execute flow 'FTPS Example' with Context{global{global_tempoffset=10630479,global_mediaoffset=10627479},local{flow_name=FTPS Example,triggertime=1524177126023,trigger=Manual}}
20.04.2018 00:32:06.033 [FTPS Example] Start executing action 'FTP Delete Files: ftps://XXX@XXX.XXX.X.X:990/XXX.txt (2)'
20.04.2018 00:32:06.410 [FTPS Example] Action 'FTP Delete Files: ftps://XXX@XXX.XXX.X.X:990/XXX.txt (2)'
javax.net.ssl.SSLHandshakeException: Connection closed by peer
	at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
	at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:302)
	at org.apache.commons.net.ftp.FTPSClient._openDataConnection_(SourceFile:646)
	at org.apache.commons.net.ftp.FTPClient._openDataConnection_(SourceFile:785)
	at org.apache.commons.net.ftp.FTPClient.initiateListParsing(SourceFile:3409)
	at org.apache.commons.net.ftp.FTPClient.initiateListParsing(SourceFile:3339)
	at org.apache.commons.net.ftp.FTPClient.listFiles(SourceFile:3016)
	at ch.gridvision.ppam.androidautomagic.c.a.at$1.a(SourceFile:295)
	at ch.gridvision.ppam.androidautomagic.c.a.at$1.c(SourceFile:178)
	at ch.gridvision.ppam.androidautomagiclib.util.cj$1.run(SourceFile:40)
	at java.lang.Thread.run(Thread.java:818)

20.04.2018 00:32:06.411 [FTPS Example] End executing action 'FTP Delete Files: ftps://XXX@XXX.XXX.X.X:990/XXX.txt (2)' and exception Connection closed by peer
20.04.2018 00:32:06.430 [FTPS Example] Flow ends execution due to errors
20.04.2018 00:32:06.432 [FTPS Example] Error:
ch.gridvision.ppam.androidautomagiclib.util.m: Connection closed by peer
	at ch.gridvision.ppam.androidautomagic.c.a.at$1.b(SourceFile:431)
	at ch.gridvision.ppam.androidautomagiclib.util.cj$1$1.run(SourceFile:52)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:135)
	at android.app.ActivityThread.main(ActivityThread.java:5246)
	at java.lang.reflect.Method.invoke(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:372)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
	at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:102)
Caused by: javax.net.ssl.SSLHandshakeException: Connection closed by peer
	at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
	at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:302)
	at org.apache.commons.net.ftp.FTPSClient._openDataConnection_(SourceFile:646)
	at org.apache.commons.net.ftp.FTPClient._openDataConnection_(SourceFile:785)
	at org.apache.commons.net.ftp.FTPClient.initiateListParsing(SourceFile:3409)
	at org.apache.commons.net.ftp.FTPClient.initiateListParsing(SourceFile:3339)
	at org.apache.commons.net.ftp.FTPClient.listFiles(SourceFile:3016)
	at ch.gridvision.ppam.androidautomagic.c.a.at$1.a(SourceFile:295)
	at ch.gridvision.ppam.androidautomagic.c.a.at$1.c(SourceFile:178)
	at ch.gridvision.ppam.androidautomagiclib.util.cj$1.run(SourceFile:40)
	at java.lang.Thread.run(Thread.java:818)

20.04.2018 00:32:06.456 [FTPS Example] Flow ended.
20.04.2018 00:32:06.478 Removed wake lock tracker [FTPS Example]
20.04.2018 00:32:06.479 Releasing wake lock tracker [FTPS Example]

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: FTPS implementation is not secure tight

Post by Martin » 21 Apr 2018 12:17

Hi,

Looks like the server closes the connection. Is there anything in the log of the server that indicates the reason for this? Can you please send the log to info@automagic4android.com?

Thanks & Regards,
Martin

Post Reply