REAL Studio 2011r1
MBS 17.3
Using CURL to upload files via SFTP.
The code below works with one SFTP server I work with and it used to work with another SFTP server I work with.
Since March it no longer works on the latter. I contacted the FTP owner regarding any changes they might have made. They said that they updated their ciphers and they no longer support ciphers that they believe are not secure. I also got the impression that other things might have been upgraded (OS, hardware, etc.), but they did not provide details.
According to them, these are the ciphers they currently support:
3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com
I tried adding those to a list as below:
d.OptionSSLCipherList = “3des-cbc:aes128-cbc:aes192-cbc:aes256-cbc:aes128-ctr:aes192-ctr:aes256-ctr:aes128-gcm@openssh.com:aes256-gcm@openssh.com:chacha20-poly1305@openssh.com”
This seemed to make no difference.
When I run the code below with this SFTP server, I receive the result:
easy handle already used in multi handle
TCP_NODELAY set
Connected to (ftp server, port 22) (#0)
Failure establishing ssh session
Closing connection 0
If you can provide any clues as to what’s causing this, I would appreciate it.
Thanks.
Code:
For i as integer = 0 to count
If Manual_Stop = False then
Dim e as Integer
Dim d as new UploadCURL
Dim b as BinaryStream
Dim currentFolderitem as FolderItem
currentFolderitem = Current_Upload_Array(i)
b = BinaryStream.Open(currentFolderitem)
Dim fileName as String = Current_Upload_Array(i).Name
Dim FTPPathAndFile as String = FTP_Host + FTP_Folder + Current_Pub_FTP_Folder_Name + “/” + fileName
d.stream = b
d.OptionURL = FTPPathAndFile
d.OptionUpload = True
d.OptionVerbose = True
d.CollectDebugData = True
d.OptionInFileSize = b.Length
d.OptionSSHAuthTypes = 2 + 8 // password, not public key
d.OptionUsername = FTP_User
d.OptionPassword = FTP_PW
d.ID = FTPPathAndFile
If CurlMulti.AddCURL(d) then
Log_Session = Log_Session + Get_Current_Time + Chr(09) + "Calling CURL routine for " + fileName + “.” + Chr(09) + “Information” + EndOfLine
AlternatingList1.AddRow “”
AlternatingList1.RowPicture(AlternatingList1.LastIndex) = Blank
AlternatingList1.CellTag(AlternatingList1.LastIndex, 0) = 0
AlternatingList1.customCell(AlternatingList1.lastIndex,3) = new ProgressCell(0,100)
d.Row = AlternatingList1.LastIndex
e=d.Perform
Else
Log_Session = Log_Session + Get_Current_Time + Chr(09) + "Calling CURL routine for " + fileName + “.” + Chr(09) + “Error” + EndOfLine
End If
dim DebugMessages as string = d.DebugData
MsgBox "Result: "+ str(DebugMessages)
End If
Next