Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is execProt("P") in Apache Commons net?

I have setup an FTPS server on my aws ec2 instance. I am using Apache Commons net to connect programmatically to my server.

try
{
    ftps.enterLocalPassiveMode();
    ftps.setBufferSize(1000);
    ftps.execPROT("P");

    if (!ftps.login(username, password))
    {
        ftps.logout();
        error = true;
        break __main;
    }
}

I cannot retrieve files if I don't set execProt("P"). From their documentation, I see that "P" stands for Private Data Channel Protection Level. What does this mean? Why am I using P instead of "S" or "E"?

like image 409
eechpeech Avatar asked Nov 01 '25 23:11

eechpeech


1 Answers

The PROT command in ftps can have the values P and C. P stands for private and means that the data connection is encrypted with TLS. C stands for clear and means that the data connection is not encrypted. The values of E (confidential) and S (safe) are defined too but in practice not implemented in FTP servers. For more details see the specification, i.e. RFC 4217.

like image 79
Steffen Ullrich Avatar answered Nov 03 '25 12:11

Steffen Ullrich