:: Apologies - Code below:
@echo off
:: FTP.CFG examples - Does FTP.CFG only support SSL over port 21? Appears so from these examples...
echo ##
echo ## Testing FTP.CFG without/with SSL over different ports
echo ##
echo NOTE: (A) Results when FTP user account allows insecure FTP...
echo (B) Results when FTP user account Forces SSL 'Force SSL for user login' - FileZilla Server
echo.
echo.
set tccfile="C:\Program Files\JPSoft\TCMD20\FTP.CFG"
set ftpsite=<FTP SERVER>
set ftpport=990
set username=<USERNAME>
set password=<PASSWORD>
set ftpFile=test.txt
echo creating %tccfile%
echo %ftpsite% (customerbackups) %username% %password% > %tccfile%
:: create mockup file to transfer
echo test > %ftpFile%
:: useful when using a port sniffer, examine one example at a time..
:: set do_one=1 to only do one example, with appropriate goto...
set do_one=0
::goto example4
echo.
:example1
echo example 1: Simple FTP
echo ---------
set ftp_protocol=FTP
copy "%ftpFile" %ftp_protocol://customerbackups/DBbackups/
echo.
echo (A) sends data over port 21 - insecure, this seems correct.
echo (B) fails if Force SSL login enabled for user, this seems correct.
echo.
if "%do_one"="1" quit
:example2
echo example 2: using FTPS protocol
echo ---------
set ftp_protocol=FTPS
copy "%ftpFile" %ftp_protocol://customerbackups/DBbackups/
echo.
echo (A) sends data over port 21 using TLS, this seems correct.
echo (B) sends data over port 21 using TLS, this seems correct.
echo.
if "%do_one"="1" quit
:example3
echo example 3: using FTP on port 990
echo ---------
set ftp_protocol=FTP
copy "%ftpFile" "%ftp_protocol://customerbackups:990/DBbackups/"
echo.
echo (A) Sends data over port 990, insecure
echo (B) FTP protocol error: 530 TLS required "FTP://customerbackups:990/DBbackups/", seems correct
echo.
if "%do_one"="1" quit
:example4
echo example 4: using FTPS on port 990
echo ---------
set ftp_protocol=FTPS
copy "%ftpFile" %ftp_protocol://customerbackups:990/DBbackups/
echo (A) Sends data over port 990 error during handshake[2]: 0x80090308 "FTPS://customerbackups:990/DBbackups"
echo (B) Sends data over port 990 error during handshake[2]: 0x80090308 "FTPS://customerbackups:990/DBbackups"
echo port sniffer shows: 500 Syntax error, command unrecognized.
echo.
if "%do_one"="1" quit
:example5
echo example 5: using FTPS on port 20
echo ---------
set ftp_protocol=FTPS
copy "%ftpFile" %ftp_protocol://customerbackups:20/DBbackups/
echo (A) error during handshake[2]: 0x80090308 "FTPS://customerbackups:20/DBbackups"
echo (B) error during handshake[2]: 0x80090308 "FTPS://customerbackups:20/DBbackups"
echo.
if "%do_one"="1" quit
:example6
echo example 6: using FTPS on port 990 - changing FTP.CFG (port needed in there?)
echo ---------
echo changing FTP.CFG and addding port %ftpport% - just incase FTP.CFG requires the port!!
echo %ftpsite%:%ftpport% (customerbackups) %username% %password% > %tccfile%
set ftp_protocol=FTPS
copy "%ftpFile" %ftp_protocol://customerbackups/DBbackups
echo (A) errors with: Host not found "ftp.axitech.co.uk:990"
echo (B) errors with: Host not found "ftp.axitech.co.uk:990"
echo.