+1 vote

My provider (1and1) has just changed all ftp accounts to ftp over TLS (ftps). My existing ftp setup in VB.Net code using the Limilabs dll has worked for years. Now if I use Myftp.Connect(ftphost) this succeeds but Myftp.Login(ftpusername, ftppassword) fails. If I try to connect using Myftp.ConnectSSL(ftphost) this fails. With Filezilla set to "Require implicit FTP over TLS" (no port number, default mode) the connection is fine. I don't know what else to try, would be grateful for all advice.

by

2 Answers

+1 vote
 
Best answer

Nope, not successful. In VB I have now -

        Try
            Limilabs.FTP.Log.Enabled = True
            Myftp = New Ftp
            Myftp.Connect(ftp_host)
            Myftp.AuthTLS()
            Myftp.Login(ftp_username, ftp_password)
        Catch ex As Exception
            ' Some explanation
        End Try

but the Myftp.AuthTLS() line trips to the Catch every time so I don't get to the login line.

Also FYI if I change to Myftp.AuthSSL() I get a warning: (Deprecated). BC40000: Public Overloads Sub AuthSSL() is obsolete.

Anything further I can try?
Nick

by (1.1k points)
selected by

Now resolved thanks to an exchange with Pawel. Thanks also for previous answers, getting there.

Successful VB code is -

Try
Myftp = New Ftp
Myftp.Connect(ftphost, portno)
Myftp.Login(ftp
username, ftppassword)
Catch ex As Exception
Myftp.Close()
Myftp = New Ftp
Myftp.SSLConfiguration.EnabledSslProtocols = SslProtocols.Tls12
Myftp.Connect(ftp
host, portno)
Myftp.AuthTLS()
Myftp.Login(ftpusername, ftppassword)
End Try

This tries FTP but if that fails drops straight into FTPS. Works for me!
Nick B

0 votes

Turn on logging:
https://www.limilabs.com/blog/logging-in-ftp-dll

Try explicit FTPS:

using (Ftp client = new Ftp())
{
    client.Connect("ftp.example.org");

    client.AuthTLS();

    client.Login("username", "password");
by (305k points)
...