Or as the grey haired folks would say “How to configure the ISERIES FTP server to use SSL” or as the geriatric brigade would say “making the AS400 talk using that newfangled secure FTP nonsense“. But of course, we know those old computers dont exist anymore and we know that some old people are crazy… so let’s look at how this years IBM i System does this stuff 😉
First things first – to use SSL FTP we need a certificate.
The IBM manual says: Use following steps to configure the iSeries FTP server to use SSL. This document was created under the assumption that the user has already assessed Digital Certificate Manager (DCM) and has already either purchased a third-party certificate, or has created their own certificate to assign to the FTP server.
So, before we start let’s make sure our ADMIN server is running:
STRTCPSVR SERVER(*HTTP) HTTPSVR(*ADMIN)
Since this is a playground setup lets create our own certificate and have a little play.
CHGFTPA AUTOSTART(*YES) ALWSSL(*YES)
This will set the Allow secure sockets layer option to *YES. The *ONLY option will also allow SSL FTP connections; however, it will not allow regular non-secure connections to come through.
After making the change, restart the FTP server (ENDTCPSVR *FTP and then STRTCPSVR *FTP).
Now, lets use the DCM to assign a certificate to the FTP server application ID. You will need to make sure the HTTP Admin server is active and that it can be accessed. In the QHTTPSVR subsystem, there should be an ADMIN job. If Admin is not active, use the command
STRTCPSVR SERVER(*HTTP) HTTPSVR(*ADMIN)
to start it.
The Admin page can be accessed by going to
http://<systemname or IP address>:2001/QIBM/ICSS/Cert/Admin/qycucm1.ndm/main0
PS: IBM have you thought about updating this page so it doesn’t look like a Netscape throwback to the 1990’s?
Click on the Select a Certificate Store button and choose the *SYSTEM store. Enter your store password when it prompts you (this was created by the individual who created the *SYSTEM store).
Once you are signed in, choose the Fast Path > Work with server and client certificates.
You will see the certificates you have to choose from on the right-hand side. Select the one you want to assign to the FTP server and click
Or lets just create one for ourselves to test with:
Preferably you will use an authorized certificate from an established CA (Certificate Authority) but we are going to cheat and use the ones that come with IBM i.
We will also stick in the *SYSTEM CERTIFICATE STORE for this example.
Just because I like to cheat I am going to POPULATE ALL
SO, that she easy bit done.
Now we can assign these certificates to the FTP SSL application and test it 🙂
Select a CERTIFICATE
Check the box for IBM i TCP/IP FTP Server and click Continue.
Click OK on the Application Status screen.
And that.. as they say… is that.
Now we just restart the FTP server application ENDTCPSVR *FTP and then STRTCPSVR *FTP.
Check NETSTAT option 3 to verify the FTP secure port is listening.
You can use F13 to sort by local port and then F14 to display the local port to make it easier to find the secure FTP listener:
Anyone who wants to connect to the FTP server securely will need the CA (Certificate Authority) of the certificate that was used to secure the FTP server.
You can export this CA and send it to whomever requires it.
In DCM again, click on the Work with CA certificates option in Fast Path.
Select the CA certificate you wish to export. If it was a locally signed certificate, you will see LOCAL_CERTIFICATE_AUTHORITY.
Select the appropriate radio button and click the Export button below.
Make sure the File radio button is selected and click Continue.
Fill in the Export to File name: field. This file will go to the IFS, and you must include the path and name of the file you are creating.
For example, to export to your personal home directory in the IFS, you could specify /home/myprofilename/cert.cer where myprofilename is your directory and cert.cer is whatever you want to call the certificate file.
The extension can be .txt, .cer, .crt, or just about whatever you choose
Note: Windows OS recognizes the .cer extension as a certificate and is probably a good choice to use.
So, I am going to use my home folder and export this
Send the file to who ever wants to use SSL FTP to connect to your box!
They can import the CA to whatever application they use for client side FTP and connect to the FTP server securely.
You can Work with Server Applications to check that the FTP app is defaulting to a specific certificate:
IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Alpha Nerd and Passionate Eater of Cheese and Biscuits. Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day. Enjoy your stay, feel free to comment and in the words of the most interesting man in the world: Stay thirsty my friend.
Cleaning messy IBM i Integrated File System (IFS) file names
How to update RDi – Rational Developer for IBM ‘i’ Programmers
How to encrypt or hide CL/RPG Source Code in ILE Debug Views
IBM i SQL – Using SUBST to insert data into a string
IBM i User Profile – Special Authorities
‘device file does not contain an entry for screen size’