Does this support SFTP?

Discussions related to FTPAPI (An FTP client package for RPG programming.) http://www.scottklement.com/ftpapi/
Post Reply
NStone
Posts: 1
Joined: Wed Aug 04, 2021 6:35 pm

Does this support SFTP?

Post by NStone »

Does the FTPAPI support SFTP?
Scott Klement
Site Admin
Posts: 732
Joined: Sun Jul 04, 2021 5:12 am

Re: Does this support SFTP?

Post by Scott Klement »

By "SFTP", do you mean the FTP-like interface for SSH? If so, that isn't actually FTP, it's just SSH with commands that are similar to FTP. It works really well, though... I'm glad to answer questions about OpenSSH if that's what you're using.

But, no, FTPAPI does not support it.

There is also a similar name "FTPS" which is FTP over SSL. This is the same protocol that FTPAPI provides, but I never added SSL support to FTPAPI. Other people have done so on their own, though. Personally, I would recommend using SFTP (SSH) instead. FTPS is, in my opinion, putting lipstick on a pig.
kabelnet
Posts: 2
Joined: Thu Oct 07, 2021 2:05 pm

Re: Does this support SFTP?

Post by kabelnet »

Hi NStone, if you need a native sftp api on OS/400, and you are familiar in C, see the libssh2 project on GitHub. It has an OS/400 version (but I think, they never use it :) It supports OS/400 crypto APIs. It is possible to build/make an usable sftp API from it.
Scott Klement
Site Admin
Posts: 732
Joined: Sun Jul 04, 2021 5:12 am

Re: Does this support SFTP?

Post by Scott Klement »

SFTP isn't FTP. They are completely different network protocols. SFTP is a command-line interface to some of the functionality of SSH.

So, no.. FTPAPI doesn't support SFTP. And never will.

Just use OpenSSH. It works really well.
MarkusN
Posts: 1
Joined: Thu Oct 21, 2021 2:57 pm

Re: Does this support SFTP?

Post by MarkusN »

Scott Klement wrote: Wed Aug 04, 2021 8:27 pm By "SFTP", do you mean the FTP-like interface for SSH? If so, that isn't actually FTP, it's just SSH with commands that are similar to FTP. It works really well, though... I'm glad to answer questions about OpenSSH if that's what you're using.

But, no, FTPAPI does not support it.

There is also a similar name "FTPS" which is FTP over SSL. This is the same protocol that FTPAPI provides, but I never added SSL support to FTPAPI. Other people have done so on their own, though. Personally, I would recommend using SFTP (SSH) instead. FTPS is, in my opinion, putting lipstick on a pig.
Hi Scott, you mentioned in your post that there are people who have implemented ftpS into the FTPAPI. Do you have the code of one of these implementations available and are willing to share it? Or can you forward my request to one of these people? Feel free to forward my email address. Thanks.
(Unfortunately, we have to put up with the pig with lipstick. :( )
Scott Klement
Site Admin
Posts: 732
Joined: Sun Jul 04, 2021 5:12 am

Re: Does this support SFTP?

Post by Scott Klement »

I didn't save the information or code, sorry. Maybe they'll see this message and reply.
kabelnet
Posts: 2
Joined: Thu Oct 07, 2021 2:05 pm

Re: Does this support SFTP?

Post by kabelnet »

MarkusN wrote: Thu Oct 21, 2021 3:08 pm Hi Scott, you mentioned in your post that there are people who have implemented ftpS into the FTPAPI. Do you have the code of one of these implementations available and are willing to share it? Or can you forward my request to one of these people? Feel free to forward my email address. Thanks.
(Unfortunately, we have to put up with the pig with lipstick. :( )
Hi MarkusN, you can find the ftps modification of ftpapi made by Craig Strong as an attached zip file in mailing archive 2007/04, in list 'FTP SSL support'.
The zip file also includes suggestions of Scott, please consider them when you implement the update.
I implemented it into my ftpapi with recommended modifications and it is working. I have found one error only: the modification does not close the secure channel when no more data to transfer. Please implement a gsk close before close socket:
c if wwRC < 1
if wkSSLBh <> *null;
gsk_secure_soc_close(wksslbh);
wksslbh = *null;
endif;

c callp close(wwSock)
c return 0
c endif
ottersberg
Posts: 2
Joined: Fri Aug 06, 2021 11:37 am

Re: Does this support SFTP?

Post by ottersberg »

Hi kabelnet,
is it possible that you share your version for FTPS here?
Scott Klement
Site Admin
Posts: 732
Joined: Sun Jul 04, 2021 5:12 am

Re: Does this support SFTP?

Post by Scott Klement »

ottersberg
Posts: 2
Joined: Fri Aug 06, 2021 11:37 am

Re: Does this support SFTP?

Post by ottersberg »

Hello Scott,
I already found that message. But it's good to have the link here, so others don't have to search for it.
What I meant:
kabelnet seems to have a version of FTPAPI with support of FTPS. So I asked him to upload his version, so that all interested in FTPS don't have to do the changes by their own.
Post Reply