PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → WD21 - FTP certificate error
WD21 - FTP certificate error
Started by Arie, Jun., 21 2018 12:45 PM - 9 replies
Posted on June, 21 2018 - 12:45 PM
Hi,

I'm trying to setup a connection to a site using "implicit FTP over TLS". It all works fine when using Filezilla. When connecting however a popup is shown that the certificate is outdated. And after confirming that the connection is established. I could not find an option to ignore this error automatically. But in the end the FTP is working and I am able to send files.

From my WD application I want to automate things because the upload is scheduled on a server to run at night times.
Therefore I need to supress this error and according to the help I can use
FTP.IgnoreError = ftpIgnoreExpiredCertificate+ftpIgnoreInvalidCertificate+ftpIgnoreInvalidCertificateName

However that does not seem to work. The FTPConnect() still is rejected and returns -1. And Errorinfo() shows me an invalid certificate message.

Anyone using this option and can confirm it SHOULD work?

I also added FTPParameter(ftpParameterMode,1) with no luck.
Posted on June, 21 2018 - 5:59 PM
Hi Arie, this "error" even comes up with WinSCP when connecting for the first time to an FTP/TLS site. Has something to do with the TLS-mechanism. Whenever this error comes up - in my case - I just tell my users, it's implicit to this type of connection, they just had to restart the connection. In principle, one could catch the error, close the connection and restart it. I decided for letting our dear customers do the restart - after all, it's only once and after that, they communicate with that site for years.
Posted on June, 22 2018 - 8:50 PM
Guenter,

I also came across WinSCP and that look's like a champions league tool.
I tried to incorporate the .NET assembly and that's just a piece of cake. However when run on the customers machine (it's a 2012 64bit server) the WinSCP executable runs fine. However, my Windev app, uncluding the .NET library of wWinSCP throws an error: unable to load win210net2.dll - but that file is there for sure!

The regular Windev FTP connect function keeps saying: "The remote certificate acnnot be authenticated". Also AFTER the first time as you mentioned.

Do you have some more tips?

In the meantime I;m looking at using the winscp.exe itself in a script with commandline parameters. That would be a workaround too.
Posted on June, 23 2018 - 1:29 PM
Hi Arie,

I don't know what exactly you are trying to do, but I'm using WinSCP too with a script to copy zipped HFSQL backups form a server to a NAS.
The backups are scheduled using HFSQL
I use Windows Task Scheduler to execute a little Windev program that creates one zip-file from all the backup directories and after that deletes the HFSQL Backups.
Then a batch file executes a WinSCP script to copy and delete the zip file(s) to the NAS.
This has been working flawlessly for years now.

If you are interested in all or part of this solution, I'm willing to share.

Kind Regards,
Piet
Posted on June, 23 2018 - 5:20 PM
Hi Arie,

initially, before getting version 18, I automated WinSCP from my WINDEV 17 (and earlier) programs to achieve FTPS because PC Soft couldn't supply a working FTPS function for FTP. That worked just fine, only the many upcoming black windows (console) were a bit irritating.

With the advent of Version 18, FTPS (TLS) was working fine. The "trick" maybe was the following:

FTP.IgnoreError = ftpIgnoreInvalidCertificate+ftpIgnoreExpiredCertificate+ftpIgnoreInvalidCertificateName+ftpIgnoreRevocation
ConnectNumber = FTPConnect("ftps://"+NoSpace(IPMailboxSystem),NoSpace(UserMailboxSystem),NoSpace(PWMailboxSystem),990,True,20)
Posted on June, 24 2018 - 8:07 AM
Hi Guenter

re ftps connectivity.

I have been trying to connect to an FTPS server for quite some time but never managed.
I have just tried your connections strings and still cannot connect.
I get this error message

Failure connecting to the FTP server on port 990 with user name .


Are there any other setting that you know about that I might use?

Thanks
Noel
Posted on June, 24 2018 - 11:10 AM
Hi Noel,

you have - of course - to choose the port of the FTP-site! There's a variety of ports possible and you have to ask for the provider of that site for the port to connect. Testing is no good because there are about 65.000 ports on all computers. (hint: you could try anyway :rp:)
Posted on June, 24 2018 - 5:10 PM
Hi Guenter

The funny thing is that I login with the same credentials using WinScp and some file explorer software (dopus)

I know the :

user id
password
ftp address
port

but I still cannot connect.

I thought that perhaps there is some other item I need to cover.
I am suing Winscp but it would be better for me to use windev all the way through.

Thanks
Noel
Posted on June, 24 2018 - 5:52 PM
Hi Noel,

did you try to change the type of the connection? ftpactive ... ftppassive .. ftpextendedpassive ... Some sites have a strict policy in regards to the connection type. There are other constants which could enable you to access the site:
https://help.windev.com/en-US/…
Posted on June, 25 2018 - 8:11 AM
Hi Guenter


will have to let it go and use winscp. any combination of ftp.ignoreerror does not seem to work.

so hopefully winscp will be ok and someday windev will work with this ftps server

Thanks for your help
Regards
Noel