Android Question Pls help with ftps custom certificate

basicuser27

Member
Licensed User
Longtime User
Hi Community,

I hope somebody can help me with my ftps issue.
net library latetst = 1.53



Sub OpenftpsConnection
FTP.PassiveMode=True
FTP.UseSSL = True
FTP.UseSSLExplicit = True
FTP.UploadFile(File.DirDefaultExternal, "1.txt", True, "1.txt")
' Show Dialog Progress - Todo
End Sub

I got the error :


-
Thanks
 

basicuser27

Member
Licensed User
Longtime User
sorry, this is the error I got..
1.txt, Success=false
java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
 
Upvote 0

basicuser27

Member
Licensed User
Longtime User
Hi,

yes I am using a self signed certificate with a Filezilla Server (in Feature it will be a Proftpd)

with this code I get the following message on the filezilla server

FTP.PassiveMode=True
FTP.UseSSL = True
FTP.UseSSLExplicit = True

ssltrustmanager.InitializeAcceptAll

FTP.SetCustomSSLTrustManager(ssltrustmanager)
FTP.Initialize("FTP",ftpshost,ftpsport, ftpsuser,ftpspass)

Filezilla FTP Log:
4 07:59:07 - (not logged in) (10.168.0.175)> Connected on port 990, sending welcome message...


Filezilla Server:
Flag on Enable FTP over SSL/TLS support (FTPS)
Flag on Allow explicit FTP over TLS

Thanks
 
Upvote 0

basicuser27

Member
Licensed User
Longtime User
with this settings

Dim ssltrustmanager As CustomTrustManager
FTP.Initialize("FTP",ftpshost,ftpsport, ftpsuser,ftpspass)

FTP.PassiveMode=True
FTP.UseSSL = True
FTP.UseSSLExplicit = False
ssltrustmanager.InitializeAcceptAll
FTP.SetCustomSSLTrustManager(ssltrustmanager)


I am getting

java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
 
Upvote 0

basicuser27

Member
Licensed User
Longtime User
Ok, thanks

with
FTP.UseSSL = False
FTP.UseSSLExplicit = True

i am getting
- (not logged in) (x.x.x.x)> Connected on port 990, sending welcome message...

i have already tried to import the custom signed certificate under the security settings on the phone...
 
Upvote 0

basicuser27

Member
Licensed User
Longtime User
now i have set the port to 21, not to 990

B4X:
FTP.Initialize("FTP",ftpshost,ftpsport, ftpsuser,ftpspass)    
       FTP.PassiveMode=True
       FTP.UseSSL = False
       FTP.UseSSLExplicit = True
       ssltrustmanager.InitializeAcceptAll
         FTP.SetCustomSSLTrustManager(ssltrustmanager)

with this is now working with authentication with TLS

B4X:
 234 Using authentication type TLS
(000015)10.11.2014 13:59:56 - (not logged in) (192.168.0.x)> SSL connection established
(000015)10.11.2014 13:59:56 - (not logged in) (192.168.x.x)> USER ftpusr
(000015)10.11.2014 13:59:56 - (not logged in) (192.168.x.x)> 331 Password required for ftpusr
(000015)10.11.2014 13:59:56 - (not logged in) (192.168.x.x)> PASS **********
(000015)10.11.2014 13:59:56 - ftpusr(192.168.x.x)> 230 Logged on

Thanks Erel for your patience !
 
Upvote 0
Top