Upload File Error Codes 12, 15, 23

I'm receiving a variety of errors when trying to upload files via FTPS.

Is there an explanation of the errors codes somewhere? It is rather difficult to search the forum for error codes when the search requires 3 characters for each search word, e.g. "Error 12"

I am explicitly setting the following parameters:

ftpCon.Passive = true
ftpCon.PROTFallback = false
ftpCon.DataProtection = ftpDataProtectionPrivate

In a test/sample environment working off the asp example provided I get errors 12 and 23 sometimes get success (0).

Adding the same code to my application I'm getting error code 15 invariably.

The same code pointed at a non FTPS/SSL server works perfectly.


Here is the end of the log for Error 15:

[20070616 00:26:08] SYST
[20070616 00:26:08] 215 UNIX
[20070616 00:26:08] Detected Server Type: UNIX
[20070616 00:26:08] FEAT
[20070616 00:26:08] 211- Extensions supported:
[20070616 00:26:08] PASV
[20070616 00:26:08] AUTH TLS
[20070616 00:26:08] PBSZ
[20070616 00:26:08] PROT
[20070616 00:26:08] CCC
[20070616 00:26:08] 211 End
[20070616 00:26:08] TYPE I
[20070616 00:26:08] 200 Type set to I
[20070616 00:26:08] REST 0
[20070616 00:26:08] 502 REST Command not implemented.
[20070616 00:26:08] PWD
[20070616 00:26:08] 257 "/usr/nn/gateway/mbox/fxf/DF459M7" is current directory.
[20070616 00:26:08] PASV
[20070616 00:26:09] 521 Data connection cannot be opened with current PROT level.


Here is the end of the log for Error 23:

[20070616 00:34:29] SYST
[20070616 00:34:29] 215 UNIX
[20070616 00:34:29] Detected Server Type: UNIX
[20070616 00:34:29] FEAT
[20070616 00:34:29] 211- Extensions supported:
[20070616 00:34:29] PASV
[20070616 00:34:29] AUTH TLS
[20070616 00:34:29] PBSZ
[20070616 00:34:29] PROT
[20070616 00:34:29] CCC
[20070616 00:34:29] 211 End
[20070616 00:34:29] TYPE I
[20070616 00:34:29] 200 Type set to I
[20070616 00:34:29] REST 0
[20070616 00:34:29] 502 REST Command not implemented.
[20070616 00:34:29] PWD
[20070616 00:34:29] 257 "/usr/nn/gateway/mbox/fxf/DF459M7" is current directory.
[20070616 00:34:29] PROT P
[20070616 00:34:29] 200 PROT Command successful.
[20070616 00:34:29] PASV
[20070616 00:34:29] 227 Entering Passive Mode (142,245,8,80,24,13)
[20070616 00:34:29] Opening data connection to 142.245.8.80 Port: 6157
[20070616 00:34:29] STOR ftp_test2.txt
[20070616 00:34:30] Connected. Exchanging encryption keys...
[20070616 00:34:30] An established connection was aborted by the software in your host machine.
[20070616 00:34:30] Server closed connection


Here is the log for Error 12:

[20070616 00:14:38] SYST
[20070616 00:14:38] 215 UNIX
[20070616 00:14:38] Detected Server Type: UNIX
[20070616 00:14:38] FEAT
[20070616 00:14:38] 211- Extensions supported:
[20070616 00:14:38] PASV
[20070616 00:14:38] AUTH TLS
[20070616 00:14:38] PBSZ
[20070616 00:14:38] PROT
[20070616 00:14:38] CCC
[20070616 00:14:38] 211 End
[20070616 00:14:38] TYPE I
[20070616 00:14:38] 200 Type set to I
[20070616 00:14:38] REST 0
[20070616 00:14:38] 502 REST Command not implemented.
[20070616 00:14:38] PWD
[20070616 00:14:38] 257 "/usr/nn/gateway/mbox/fxf/DF459M7" is current directory.
[20070616 00:14:38] PROT P
[20070616 00:14:38] 200 PROT Command successful.
[20070616 00:14:38] PASV
[20070616 00:14:39] 227 Entering Passive Mode (142,245,46,80,24,36)
[20070616 00:14:39] Opening data connection to 142.245.46.80 Port: 6180
[20070616 00:14:39] STOR ftp_test6.txt
[20070616 00:14:39] Connected. Exchanging encryption keys...
[20070616 00:14:39] Session Cipher: 128 bit RC4
[20070616 00:14:39] TLS encrypted session established.
[20070616 00:14:39] SSL/TLS network error.
[20070616 00:14:39] An existing connection was forcibly closed by the remote host.
[20070616 00:14:39] Client closed the connection.


I am most concerned with Error Code 15, which makes no sense considering I am explicitly specifying DataProtection = ftpDataProtectionPrivate.

Please Advise,

Thanks,
Chet

Hello ...

Error 15 doesn't make sense to me. The PROT command is sent at least once. Are you reusing the connection?

For the other errors, they are probably related to the NAT router which is between your client and the server. In a secured connection (FTPS) the NAT router cannot read the commands and therefore it cannot translate the IP address in the PORT/PASV commands and it's also unable to automatically open the ports in its firewall. Another problem might be that the server requries a client certificate. If it works with the SmartFTP client (it uses a client cert by default) then you need to set a client certificate for your FTPConnection. See ClientCert property.

Regards,
-Mat