PROT P required

Mar 19, 2012 at 5:11 PM
Edited Mar 19, 2012 at 5:11 PM

I came across Alex FTPS client today and seems to be what I am looking for, but continue to get the message "PROT P required" when testing the connection. 

Version 1.1.0

If I run "ftps -h -U user -P pass -ssl Implicit -p c:\test.txt /"    I get the "PROT P required" message.

If I run "ftps -h -U user -P pass -ssl Implicit -cust "PROT P"  that returns the correct message.

The ftps connection works fine through Filezilla.     It also won't let me combine the commands as it says that is invalid.

Any help would be appreciated. 


Mar 23, 2012 at 3:46 AM

The message indicate sa request for an explicit FTPS connect by the server.

Can you please post the filezilla log?

Mar 28, 2012 at 9:16 PM
Edited Mar 28, 2012 at 9:17 PM

I essentially have the same problem, so I'll post it here. The server to which I'm connecting requires Implicit FTP over TLS. I'm not using the shell, but through 

alex.Connect(_hostName, _port, new NetworkCredential(_userName, _password), ESSLSupportMode.Implicit, new System.Net.Security.RemoteCertificateValidationCallback(AcceptCertificatePolicy), null, 0, 0, 0, null);
alex.PutFile(localFileName, remoteFileName); //PROT P required thrown here

Filezilla works fine- here's the log:

Status: Resolving address of
Status: Connecting to xx.xx.xx.xx:990...
Status: Connection established, initializing TLS...
Status: Verifying certificate...
Status: TLS/SSL connection established, waiting for welcome message...
Response: 220-************************************************
Command: USER Username
Response: 331 Password required for Username
Command: PASS ********
Response: 230 Logged on
Command: PBSZ 0
Response: 200 PBSZ=0
Command: PROT P
Response: 200 Protection level set to P
Status: Connected
Status: Starting upload of \\myfilepath\myfile.csv
Command: CWD /newDir
Response: 250 CWD successful. "/newDir" is current directory.
Command: TYPE I
Response: 200 Type set to ICommand: PASV
Response: 227 Entering Passive Mode (xx.xx.xx.xx,19,228)
Command: STOR myfile.csv
Response: 150 Connection accepted
Response: 226 Transfer OK
Status: File transfer successful, transferred 617 bytes in 1 second
Status: Retrieving directory listing...
Command: PASV
Response: 227 Entering Passive Mode (xx.xx.xx.xx,19,229)
Command: MLSD
Response: 150 Connection accepted
Response: 226 Transfer OK
Status: Directory listing successful


Thank you.

Apr 12, 2012 at 12:07 PM

Can you try please the latest beta:

There's already a patch in place to handle PROT P commands in Implicit connections.

If it doesn't work can you please post an AlexFTPS log that you can obtain by adding "-logFile output.txt"



Alessandro Pilotti

[ MVP ASP.Net / IIS]

Apr 12, 2012 at 4:58 PM

I have found another ftp library that solves this issue.

However, if I have some time in the next few days, I'll try out the beta and let you know the results.

Apr 17, 2012 at 10:17 PM


I managed to find the problem thanks to a user's log. Here's the solution, it will go also in the next release:



Jul 7, 2014 at 9:17 AM
Works fine.
Mar 4, 2015 at 4:27 PM
Had "ERROR: The handshake failed due to an unexpected packet format." it worked in Filezilla which seems to issue PBSZ 0 and PROT P commands, but it failed in AlexFtps, even with the patch mentioned! In my case, the problem came from server returning features with a leading space, therefore the call to PROT P was never done. See my post+fix here: