You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Barak Kedem (JIRA)" <ji...@apache.org> on 2017/01/02 07:18:58 UTC

[jira] [Updated] (NET-607) Apache FTPS Client storeFile to windows FTPS server from Unix/Linux/Max issue

     [ https://issues.apache.org/jira/browse/NET-607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Barak Kedem updated NET-607:
----------------------------
    Description: 
i have an issue transferring files to Windows FTP server from Unix/Mac/Linux env.

while the exact same java code works from windows pc. from *Nix/Mac the transfer only worked with this commands on the ftp session
{code}
set ftps:initial-prot 
set ftp:ssl-force true
set ftp:ssl-protect-data true
set ssl:verify-certificate no
{code}
while on my windows machine i didnt need them - i assume it relates to system variable.

This is my java code
{code}
protected FTPClient getClient(DeliveryDetails details) {
    return new FTPSClient(false); // the connection is Explicit
}

public void setClient(FTPClient client, DeliveryDetails details) throws Exception {
    client.setConnectTimeout(10000);
    client.setDefaultTimeout(1000 * 60 * 2);
    client.setControlKeepAliveTimeout(300);
    client.setDataTimeout(15000);
    client.connect(ftpDetails.host, ftpDetails.port);
    client.setBufferSize(1024 * 1024);
    client.login(ftpDetails.username, ftpDetails.getSensitiveData());
    client.setControlEncoding("UTF-8");
    client.setFileType(FTP.BINARY_FILE_TYPE);
    client.setFileTransferMode(FTP.BLOCK_TRANSFER_MODE);
    FTPSClient ftpsClient = (FTPSClient) client;
    ftpsClient.execPBSZ(0);
    ftpsClient.execPROT("P");
    // both with it and without it didnt work ftpsClient.setWantClientAuth(false);
}

public void saveToServer(FTPClient client, File fileName, InputStream stream){
    BufferedInputStream bis = new BufferedInputStream(stream);
    boolean isSaved = client.storeFile(filename, bis);
    client.logout();
}
{code}
‌What is equivalent of this parameters in the FTPS Apache class ?
{code}
set ftps:initial-prot 
set ftp:ssl-force true
set ftp:ssl-protect-data true
set ssl:verify-certificate no
{code}

  was:
i have an issue transferring files to Windows FTP server from Unix/Mac/Linux env.

while the exact same java code works from windows pc. from *Nix/Mac the transfer only worked with this commands on the ftp session

set ftps:initial-prot 
set ftp:ssl-force true
set ftp:ssl-protect-data true
set ssl:verify-certificate no
while on my windows machine i didnt need them - i assume it relates to system variable.

This is my java code

protected FTPClient getClient(DeliveryDetails details) {
    return new FTPSClient(false); // the connection is Explicit
}

public void setClient(FTPClient client, DeliveryDetails details) throws Exception {
    client.setConnectTimeout(10000);
    client.setDefaultTimeout(1000 * 60 * 2);
    client.setControlKeepAliveTimeout(300);
    client.setDataTimeout(15000);
    client.connect(ftpDetails.host, ftpDetails.port);
    client.setBufferSize(1024 * 1024);
    client.login(ftpDetails.username, ftpDetails.getSensitiveData());
    client.setControlEncoding("UTF-8");
    client.setFileType(FTP.BINARY_FILE_TYPE);
    client.setFileTransferMode(FTP.BLOCK_TRANSFER_MODE);
    FTPSClient ftpsClient = (FTPSClient) client;
    ftpsClient.execPBSZ(0);
    ftpsClient.execPROT("P");
    // both with it and without it didnt work ftpsClient.setWantClientAuth(false);
}

public void saveToServer(FTPClient client, File fileName, InputStream stream){
    BufferedInputStream bis = new BufferedInputStream(stream);
    boolean isSaved = client.storeFile(filename, bis);
    client.logout();
}
‌What is equivalent of this parameters in the FTPS Apache class ?

set ftps:initial-prot 
set ftp:ssl-force true
set ftp:ssl-protect-data true
set ssl:verify-certificate no



> Apache FTPS Client storeFile to windows FTPS server from Unix/Linux/Max issue
> -----------------------------------------------------------------------------
>
>                 Key: NET-607
>                 URL: https://issues.apache.org/jira/browse/NET-607
>             Project: Commons Net
>          Issue Type: Bug
>            Reporter: Barak Kedem
>            Priority: Critical
>
> i have an issue transferring files to Windows FTP server from Unix/Mac/Linux env.
> while the exact same java code works from windows pc. from *Nix/Mac the transfer only worked with this commands on the ftp session
> {code}
> set ftps:initial-prot 
> set ftp:ssl-force true
> set ftp:ssl-protect-data true
> set ssl:verify-certificate no
> {code}
> while on my windows machine i didnt need them - i assume it relates to system variable.
> This is my java code
> {code}
> protected FTPClient getClient(DeliveryDetails details) {
>     return new FTPSClient(false); // the connection is Explicit
> }
> public void setClient(FTPClient client, DeliveryDetails details) throws Exception {
>     client.setConnectTimeout(10000);
>     client.setDefaultTimeout(1000 * 60 * 2);
>     client.setControlKeepAliveTimeout(300);
>     client.setDataTimeout(15000);
>     client.connect(ftpDetails.host, ftpDetails.port);
>     client.setBufferSize(1024 * 1024);
>     client.login(ftpDetails.username, ftpDetails.getSensitiveData());
>     client.setControlEncoding("UTF-8");
>     client.setFileType(FTP.BINARY_FILE_TYPE);
>     client.setFileTransferMode(FTP.BLOCK_TRANSFER_MODE);
>     FTPSClient ftpsClient = (FTPSClient) client;
>     ftpsClient.execPBSZ(0);
>     ftpsClient.execPROT("P");
>     // both with it and without it didnt work ftpsClient.setWantClientAuth(false);
> }
> public void saveToServer(FTPClient client, File fileName, InputStream stream){
>     BufferedInputStream bis = new BufferedInputStream(stream);
>     boolean isSaved = client.storeFile(filename, bis);
>     client.logout();
> }
> {code}
> ‌What is equivalent of this parameters in the FTPS Apache class ?
> {code}
> set ftps:initial-prot 
> set ftp:ssl-force true
> set ftp:ssl-protect-data true
> set ssl:verify-certificate no
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)