|
-
Oct 1st, 2022, 09:10 AM
#1
Thread Starter
Lively Member
[RESOLVED] VB6 and (S)FTP
In the past I have supplied my programs with new versions via FTP. The program connected to the server, compared the available versions and loaded new data if necessary.
My server hoster has recently blocked all unencrypted FTP connections. For simple downloads I use now HTTP(S). I have a small PHP script on the server for this. But there are more complex things for which (S)FTP would be better.
Using WinSCP, I have explored the possibilities. The following would work:
- SFTP via port 22
- FTP with "TLS/SSL Explicit encryption" over port 21
WinSCP even offers a DLL that supports both. However, this is a .Net DLL that can only be used from VB6 via wrapper. This complicates the installation for the end user. Many dependencies, COM registration, etc. (https://winscp.net/eng/docs/library_install#registering)
Overall, VB6 and SFTP seem to be located on different hemispheres.... 
Do you have any better ideas?
Last edited by wwolf; Oct 1st, 2022 at 09:15 AM.
-
Oct 1st, 2022, 10:20 AM
#2
Re: VB6 and (S)FTP
We use the Chilkat-COM-Dll (for secure Mailings, and secure FTP).
Not freeware, though stable, well-maintained and well-hardened.
Olaf
-
Oct 1st, 2022, 11:36 AM
#3
Re: VB6 and (S)FTP
+1 for the Chilkat bundle. It has a lot of other useful stuff too (HTTP(s), SSH, Email (SMTP/POP3/IMAP), Encryption/Decryption, Encoding/Decoding, Compression/Decompression, Sockets/WebSockets, and more...).
-
Oct 1st, 2022, 02:30 PM
#4
Re: VB6 and (S)FTP
See:
https://www.vbforums.com/showthread....-File-Transfer
It is designed to send encrypted files to the listening end, but could be modified to work the other way around.
J.A. Coutts
-
Oct 1st, 2022, 02:52 PM
#5
Re: VB6 and (S)FTP
Get started with OpenSSH for Windows
Among things this alludes to and implies it includes a native SFTP command-line client. Windows 10 and probably 11 (I haven't looked there yet) as well. Probably easy enough to start an instance and "puppeteer" it via StdIO redirection to pipes.
The downside is that it's an optional feature most users probably don't have installed. That makes 3rd party deployable alternatives superior.
-
Oct 1st, 2022, 02:53 PM
#6
Re: VB6 and (S)FTP
 Originally Posted by jpbro
+1 for the Chilkat bundle. It has a lot of other useful stuff too (HTTP(s), SSH, Email (SMTP/POP3/IMAP), Encryption/Decryption, Encoding/Decoding, Compression/Decompression, Sockets/WebSockets, and more...).
Same here..
-
Oct 2nd, 2022, 07:10 AM
#7
Re: VB6 and (S)FTP
The natural continuation of FTP is FTPS. This is like securing HTTP with TLS becomes HTTPS.
SFTP is a totally different beast altogether. This is the "file transfer protocol" (FTP subsystem) in SSH servers. The same way there is "file transfer protocol" (FTP module) in VNC servers too. These totally have nothing to do with FTP protocol on port 21 you have been using so far.
Anyway, FTPS on port 990 (so called implicit secure FTP) is deprecated i.e. the closest thing to HTTPS (which is implicit secure HTTP) is deprecated for one reason or another. This is probably done to deprecate FTP as a protocol which is super ancient and badly designed long before NAT devices were invented.
What is not deprecated is a a form of FTPS called "explicit secure FTP" and abbreviated to FTPES. This starts like regular FTP on port 21 but just before sending credentials a STARTTLS command is issued which secures plain-text FTP connection with a TLS session.
Note that curl utility (preinstalled on win10+) supports both FTPS (implicit TLS) w/ curl ftps://server:990/path/file and FTPES (explicit TLS) w/ curl ftp://server:21/path/file --ftp-ssl where ports in URL are optional (given ports being default ones).
Edit: You can implement FTPS and FTPES using VbAsyncSocket for the TLS part but will need to reimplement the FTP protocol on low winsock level. There are a several FTP client implementations in the CodeBank here which can be ported to FTPS using this approach.
cheers,
</wqw>
Last edited by wqweto; Oct 2nd, 2022 at 12:21 PM.
-
Oct 3rd, 2022, 05:21 AM
#8
Thread Starter
Lively Member
Re: VB6 and (S)FTP
Thank you very much for the useful suggestions. Chilkat's licensing model is very fair for the developer and the end user. It also meets my requirements and requires the least effort to do so. I will have a closer look at it. I will have to accept the additional 10 MB in my distributions, even if I only need 5% of the DLL.
W. Wolf
-
Oct 3rd, 2022, 05:29 AM
#9
Thread Starter
Lively Member
Re: VB6 and (S)FTP
 Originally Posted by couttsj
See:
...but could be modified to work the other way around.
J.A. Coutts
As I understand it, I need server-side software for this as well? I have already implemented something like that in the form of my PHP script and HTTP(S). However, I would still have to reprogram a lot on the server side to get my old FTP functionality. That's what I don't really want to have....
W. Wolf
-
Oct 3rd, 2022, 05:32 AM
#10
Thread Starter
Lively Member
Re: VB6 and (S)FTP
 Originally Posted by dilettante
Windows 10 and probably 11 (I haven't looked there yet) as well.
Windows 7 is still mandatory for me and my users. That will not change anytime soon.
W. Wolf
-
Oct 3rd, 2022, 06:32 AM
#11
Re: VB6 and (S)FTP
My server hoster has recently blocked all unencrypted FTP connections
 Originally Posted by wwolf
As I understand it, I need server-side software for this as well? I have already implemented something like that in the form of my PHP script and HTTP(S). However, I would still have to reprogram a lot on the server side to get my old FTP functionality. That's what I don't really want to have....
The server provider should have sFTP server software, not something you normally implement yourself.
-
Oct 4th, 2022, 12:53 AM
#12
Thread Starter
Lively Member
Re: VB6 and (S)FTP
 Originally Posted by Arnoutdv
The server provider should have sFTP server software, not something you normally implement yourself.
Sure, the server supports SFTP, I have already written. My comment about server software was related to the answer of couttsj, where it is about own impementations on both sides. That's how I understood it. For Chilkat I don't need anything new on the server side, of course. W. Wolf
-
Dec 27th, 2022, 11:05 AM
#13
Thread Starter
Lively Member
Re: VB6 and (S)FTP
 Originally Posted by Schmidt
We use the Chilkat-COM-Dll (for secure Mailings, and secure FTP).
Not freeware, though stable, well-maintained and well-hardened.
Olaf
I also bought the chilkatsoft and was happy at first. Now a first problem has arisen with the DLL. Maybe it doesn't apply to you at all. If so, how could you solve this?
I use my AX-DLLs and OCX always regfree. This prevents a lot of trouble. Since I usually have RC6 with me, I use RefFree here:
Code:
Set glob = New_c.RegFree.GetInstance(App_Path & "\ChilkatAx-9.5.0-win32.dll", "ChilkatGlobal"
Set sftp = New_c.RegFree.GetInstance(App_Path & "\ChilkatAx-9.5.0-win32.dll", "ChilkatSFtp")
This works fine. However, there are also object instances in the DLL that are created by the DLL and end up as function returns in my code:
Code:
Set dirListing = sftp.ReadDir(dHandle)
From this line on, the chilkatsoft DLL is loaded a second time, this time from the place where the DLL is registered. However, in the exe at the customer the DLL is not registered and there it crashes.
This prevents the use of the DLL at least in RC6 RegFree mode. Remains only the way about a manifest. I have not tested that yet.
W. Wolf
-
Dec 27th, 2022, 11:50 AM
#14
Re: [RESOLVED] VB6 and (S)FTP
 Originally Posted by wwolf
In the past I have supplied my programs with new versions via FTP. The program connected to the server, compared the available versions and loaded new data if necessary.
Why are you using FTP to get the new versions? Do you also need to upload data instead of just download?
-
Dec 28th, 2022, 05:18 AM
#15
Thread Starter
Lively Member
Re: [RESOLVED] VB6 and (S)FTP
 Originally Posted by VanGoghGaming
Why are you using FTP to get the new versions? Do you also need to upload data instead of just download?
That is one of the reasons. I use a form of WebEDI service based on FTP (does this exist outside of Germany?). Our provider has offered FTP and SFTP so far. However, FTP is to be discontinued. Overall, I find SFTP also better, because the transferred data are sometimes also worth protecting. W. Wolf
-
Dec 28th, 2022, 05:42 AM
#16
Addicted Member
Re: VB6 and (S)FTP
 Originally Posted by wwolf
I also bought the chilkatsoft and was happy at first. Now a first problem has arisen with the DLL. Maybe it doesn't apply to you at all. If so, how could you solve this?
I use my AX-DLLs and OCX always regfree. This prevents a lot of trouble. Since I usually have RC6 with me, I use RefFree here:
Code:
Set glob = New_c.RegFree.GetInstance(App_Path & "\ChilkatAx-9.5.0-win32.dll", "ChilkatGlobal"
Set sftp = New_c.RegFree.GetInstance(App_Path & "\ChilkatAx-9.5.0-win32.dll", "ChilkatSFtp")
This works fine. However, there are also object instances in the DLL that are created by the DLL and end up as function returns in my code:
Code:
Set dirListing = sftp.ReadDir(dHandle)
From this line on, the chilkatsoft DLL is loaded a second time, this time from the place where the DLL is registered. However, in the exe at the customer the DLL is not registered and there it crashes.
This prevents the use of the DLL at least in RC6 RegFree mode. Remains only the way about a manifest. I have not tested that yet.
W. Wolf
I use Chilkat tools in Regfree mode. I had questioned the author of the tools, had provided him the link in this forum talking about the creation of manifest and here is his blog answer:
https://cknotes.com/regfree-com-usin...nology-in-vb6/
François
-
Dec 28th, 2022, 05:55 AM
#17
Addicted Member
-
Dec 28th, 2022, 03:09 PM
#18
Thread Starter
Lively Member
Re: VB6 and (S)FTP
 Originally Posted by saturnian
Danke für die Links. Der Manifest-Ansatz wäre mein nächster Ansatz gewesen. Ich verwende das allerdings nur für OCX-Dateien, weil für DLLs der RC6-Methode komfortabler ist. Bei der Chilkat funktioniert das leider nicht überall. Manifest ist auch ok. W. Wolf
-
Dec 30th, 2022, 01:01 PM
#19
Addicted Member
Re: VB6 and (S)FTP
 Originally Posted by wwolf
Danke für die Links. Der Manifest-Ansatz wäre mein nächster Ansatz gewesen. Ich verwende das allerdings nur für OCX-Dateien, weil für DLLs der RC6-Methode komfortabler ist. Bei der Chilkat funktioniert das leider nicht überall. Manifest ist auch ok. W. Wolf
Although named ".dll" the Chilkat object is an OCX, in fact
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|