Operating System - OpenVMS
1748123 Members
3352 Online
108758 Solutions
New Discussion юеВ

Re: OpenVMS SFTP C Library

 
Jeremy Williams 13
New Member

OpenVMS SFTP C Library

We currently are using an FTP C Library within our OpenVMS c code for certain situations. We now have a desire to do some of the same operations through a more secure channel. Does anyone know of a SFTP C Library that we will be able to use on our OpenVMS system?

Thanks,

Jeremy
7 REPLIES 7
Hoff
Honored Contributor

Re: OpenVMS SFTP C Library

AFAIK, neither TCP/IP Services nor OpenVMS itself include sftp. One of the third-party stacks might have a library, I've not looked.

As for options, there's libcurl at http://curl.haxx.se/
Craig A Berry
Honored Contributor

Re: OpenVMS SFTP C Library

Recent TCP/IP Services definitely include sftp:


$ tcpip show vers

HP TCP/IP Services for OpenVMS Alpha Version V5.6
on a COMPAQ Professional Workstation XP1000 running OpenVMS V8.3

$ sftp -v
Sftp2/SFTP2.C:4543: CRTL version (SYS$SHARE:DECC$SHARE ident) is: V8.3-01

SshFileCopy/SSHFILECOPY.C:1080: Making local connection.
Ssh2SftpServer/SSHFILEXFERS.C:1754: Received SSH_FXP_INIT
Ssh2SftpServer/SSHFILEXFERS.C:1799: version is 3
SshFileCopy/SSHFILECOPY.C:1019: Connection to local, ready to serve requests.
Sftp2/SFTP2.C:728: Connection ready.
SshReadLine/SSHREADLINE.C:3652: Initializing ReadLine...
sftp>


You may already have the requisite library functions available, but as far as I know, the API is not published or supported. libcurl does seem like a good alternative.
Richard Whalen
Honored Contributor

Re: OpenVMS SFTP C Library

I suspect that you are currently using TCPware, as I think that is the only TCP/IP stack for OpenVMS that comes with a FTP programming library.

If you look at the SFTP draft (it never made it to RFC state), then you will see that it is very different from FTP. http://www.vandyke.com/technology/draft-ietf-secsh-filexfer.txt

Another option to add security to your transfers, that would require very few changes to your existing programs, would be to use the FTPS functionality in the TCPware 5.8 FTP programming library. http://www.process.com/tcpip/tcpware58docs/html/programmer/ch07.htm#E52E55
The additional calls that you would need to make are FTP_AUTH, FTP_PBSZ, FTP_PROT and possibly FTP_CCC. You would also want to read RFC 4217 and possibly RFC 2228.
SDIH1
Frequent Advisor

Re: OpenVMS SFTP C Library

I couldn't find a usable C library for SFTP, and definitely not one usable on VMS.

FTPS is completely different from SFTP, and cannot be used in many circumstances, as either the systems or the organizations supporting those systems do not (want to) support it.

I did find a reasonably nice java library
that runs on OpenVMS, which I have used to
do some special stuff where the standard SFTP command line is simply to cumbersome for. Google for jsch if you're interested.
Hoff
Honored Contributor

Re: OpenVMS SFTP C Library

The cURL sftp software (including libcurl) has been ported to OpenVMS, and would be a reasonable starting point for a callable sftp mechanism. Sources and binary kits for OpenVMS and other platforms can be acquired at:

http://curl.haxx.se/

Marty Kurht has the curllib.olb pieces included in the OpenVMS binary kit that is available for download at the cURL web site, and the cURL documentation references support for sftp and ftps, and various other mechanisms. Or you can build cURL from the provided sources, if you don't want to use Marty's pieces.

OpenVMS increasingly requires the site-local assembly of the platform from software acquired from various sources, whether from the add-on kits offered from HP (IP, SWS, gnv, languages, etc), or alternate web servers (eg: OSU) or languages (eg: Lua), or (for this case) packages and libraries such as cURL. The libcurl (curllib) stuff is a C library, though there are generally options for various other programming languages on OpenVMS including the Luacurl library available for Lua at

http://luacurl.luaforge.net/

SDIH1
Frequent Advisor

Re: OpenVMS SFTP C Library

I missed out on curl lately! They do seem to support sftp now! ( they didn't for a
long time).
The curl library is working ok from C, I'll
have a try myself on a few processes that could do with an upgrade.
Jeremy Williams 13
New Member

Re: OpenVMS SFTP C Library

Currently we are running HP TCP/IP Server for OpenVMS Alpha Version V5.6 and it definitely supports SFTP as we are able to use it from the command line, we are just looking for an alternative with the ability to call it from our C programs. I hadn't come across Curl before so we will have to take a look at it.

>tcpip show vers

HP TCP/IP Services for OpenVMS Alpha Version V5.6
on an hp AlphaServer ES47 7/1150 running OpenVMS V8.3

>sftp -v
Sftp2/SFTP2.C:4543: CRTL version (SYS$SHARE:DECC$SHARE ident) is: V8.3-01

SshFileCopy/SSHFILECOPY.C:1080: Making local connection.
Ssh2SftpServer/SSHFILEXFERS.C:1754: Received SSH_FXP_INIT
Ssh2SftpServer/SSHFILEXFERS.C:1799: version is 3
SshFileCopy/SSHFILECOPY.C:1019: Connection to local, ready to serve requests.
Sftp2/SFTP2.C:728: Connection ready.
SshReadLine/SSHREADLINE.C:3652: Initializing ReadLine...