My hosting service now requires TLS 1.2.
I am trying this library to see if it will work for me but am getting an error:
Tried to read a line. No data received. Please make sure that antivirus and firewall software are disabled or configured correctly.
It logs on fine, but I get the error at the point I try to upload the file.
When I check the server there is a 0-byte file there.
Here is my code:
Try
fFTPS.Mode = Client.FtpMode.Passive
fFTPS.SSLConfiguration.EnabledSslProtocols =
Security.Authentication.SslProtocols.Tls12
fFTPS.Connect(Me.FTPHost)
fFTPS.AuthTLS()
fFTPS.Login(Me.FTPUsername, Me.FTPPassword)
If fFTPS.Connected Then
If LocalUploadFile.Exists Then
If Not fFTPS.FolderExists(Me.FTPFolder) Then
fFTPS.CreateFolder(Me.FTPFolder)
End If
fFTPS.ChangeFolder(Me.FTPFolder)
Dim ulBytes As Byte() = Encoding.Default.GetBytes(
LocalUploadFile.FullName)
Response = fFTPS.Upload(RemoteUploadFile, ulBytes)
.Message
If fFTPS.FileExists(RemoteUploadFile) Then
Me.LastFTPError = "ok"
Return True
Else
Me.LastFTPError = "upload file not found"
Return False
End If
Else
Me.LastFTPError = "local file missing"
Return False
End If
Else
Me.LastFTPError = "FTP Did not connect!"
Return False
End If
Catch ex As Exception
Me.LastFTPError = ex.Message
Return False
Finally
Try
If fFTPS.FileExists(RemoteUploadFile) Then
fFTPS.DeleteFile(RemoteUploadFile)
End If
Catch ex As Exception
'don't care
End Try
fFTPS.Close()
If LocalUploadFile.Exists Then
LocalUploadFile.Delete()
End If
End Try
Got it:
Here is the output:
2.0.20006.1858
Connecting to 'www.redactive.com:21', SSL: False.
Control connection uses port: 51264 (200,64)
S: 220-------- Welcome to Pure-FTPd [privsep] [TLS] --------
S: 220-You are user number 2 of 50 allowed.
S: 220-Local time is now 13:10. Server port: 21.
S: 220-This is a private system - No anonymous login
S: 220-IPv6 connections are also welcome on this server.
S: 220 You will be disconnected after 15 minutes of inactivity.
C: AUTH TLS
S: 234 AUTH TLS OK.
C: USER
S: 331 User OK. Password required
C: PASS
S: 230 OK. Current restricted directory is /
C: FEAT
S: 211-Extensions supported:
S: EPRT
S: IDLE
S: MDTM
S: SIZE
S: MFMT
S: REST STREAM
S: MLST type;size;sizd;modify;UNIX.mode;UNIX.uid;UNIX.gid;unique;
S: MLSD
S: AUTH TLS
S: PBSZ
S: PROT
S: UTF8
S: TVFS
S: ESTA
S: PASV
S: EPSV
S: SPSV
S: ESTP
S: 211 End.
C: OPTS UTF8 ON
S: 200 OK, UTF-8 enabled
C: PWD
S: 257 "/" is your current location
C: MLST severestudios
S: 250-Begin
S: type=dir;sizd=4096;modify=20200506170836;UNIX.mode=0755;
UNIX.uid=995;UNIX.gid=944;unique=fd00g1f1c05d; severestudios
S: 250 End.
C: CWD severestudios
S: 250 OK. Current directory is /severestudios
C: TYPE I
S: 200 TYPE is now 8-bit binary
C: PBSZ 0
S: 200 PBSZ=0
C: PROT P
S: 200 Data protection level set to "private"
C: PASV
S: 227 Entering Passive Mode (216,222,194,88,172,123)
C: STOR tmp237F.tmp
S: 150 Accepted data connection
Data connection established.
Exception thrown: 'Limilabs.FTP.Client.FtpException' in Ftp.dll
The exception message is: Tried to read a line. No data received. Please make sure that antivirus and firewall software are disabled or configured correctly.
Note: WinSCP works so the issue is not with my firewall.