FTPS support

One Star

FTPS support

Hello
We are using TALEND to put some files to a FTP server. Server uses FTPS (SSL/TLS)... and we are having problems with a setting of a property in
class it.sauronsoftware.ftp4j.FTPClient

we can't set it to SECURITY_FTPS. By UI it is automaticaly set to SECURITY_FTPES
So ... we wrote a code sample ... and if we connect by setting it SECURITY_FTPS it works.
		javax.net.ssl.SSLContext sslContext = null;
javax.net.ssl.TrustManager[] trustManager = null;
javax.net.ssl.SSLSocketFactory sslSocketFactory = null;
it.sauronsoftware.ftp4j.FTPClient ftp_tFTPConnection_2 = null;
MyTrust_tFTPConnection_2 myTrust_tFTPConnection_2 = null;
try {
try {
System.out.println("Conn start");
sslContext = javax.net.ssl.SSLContext.getInstance("SSL");
myTrust_tFTPConnection_2 = new MyTrust_tFTPConnection_2();
trustManager = myTrust_tFTPConnection_2.getTrustManagers();
sslContext.init(null, trustManager,
new java.security.SecureRandom());
sslSocketFactory = sslContext.getSocketFactory();
System.out.println("Conn socket start");
ftp_tFTPConnection_2 = new it.sauronsoftware.ftp4j.FTPClient();
ftp_tFTPConnection_2.setSSLSocketFactory(sslSocketFactory);
//not working
// ftp_tFTPConnection_2.setSecurity(it.sauronsoftware.ftp4j.FTPClient.SECURITY_FTPES);
//working
ftp_tFTPConnection_2.setSecurity(it.sauronsoftware.ftp4j.FTPClient.SECURITY_FTPS);
System.out.println("Conn start ... init");

So ... question is - how to set via UI or is there some other way ... that the property will be set SECURITY_FTPS
ftp_tFTPConnection_2.setSecurity(it.sauronsoftware.ftp4j.FTPClient.SECURITY_FTPS);

and not SECURITY_FTPES
ftp_tFTPConnection_2.setSecurity(it.sauronsoftware.ftp4j.FTPClient.SECURITY_FTPES);

Re: FTPS support

You can modify the tFTPConnection component to generate the correct code. look in <talend_install>\plugins\org.talend.designer.components.localprovider_<version#>\components
I would suggest copying the tFTPConnection and making a whole "new" component rather than just editing the existing one.
Seventeen Stars

Re: FTPS support

hi all,
and the SFTP option isn't enought for your need ?
regards
laurent
Six Stars

Re: FTPS support

kzone,
I think SFTP is not the solution here as far as this is SSH File Transfer Protocol if they do not have SSH daemon running on the destination. What is dvojnik talking about is FTPS.
Dvojnik,
The issue is that this component wasn't defined in way of let user select the Implicit or Explicit SSL when talking to FTP server.
The flag has following meaning:
SECURITY_FTPS
FTP over SSL (Explicit) Explicit security requires that the FTP client issues a specific command to the FTP server after establishing a connection to establish the SSL link. In explicit SSL (or in TLS) the FTP client needs to send an explicit command ( i.e. "AUTH SSL" or "AUTH TLS") to FTP server to initiate a secure control connection. The default FTP server port is used. This formal method is documented in RFC 2228.
SECURITY_FTPES
FTP over SSL (Implicit) Implicit security is a mechanism by which security is automatically turned on as soon as the FTP client makes a connection to an FTP server. In this case, the FTP server defines a specific port for the client (990) to be used for secure connections.
I also would recommend create temporarily custom component where you change this flag by yourself.
On the other hand you could also keep an eye at http://www.talendforge.org/bugs/view.php?id=17045 where I already repoted this behavior and request new features for tFTPConnection as you can see at the bugtracker site.
Best regards,
archenroot
Seventeen Stars

Re: FTPS support

I think SFTP is not the solution here as far as this is SSH File Transfer Protocol if they do not have SSH daemon running on the destination. What is dvojnik talking about is FTPS.

... I need to read more carefully post !!! sorry for the "hors - sujet" ! Smiley Happy
laurent
One Star

Re: FTPS support

Thank you all for your answers. They helped a lot.
You can modify the tFTPConnection component to generate the correct code. look in <talend_install>\plugins\org.talend.designer.components.localprovider_<version#>\components
I would suggest copying the tFTPConnection and making a whole "new" component rather than just editing the existing one.

Thank you for your suggestion. We have done that and it works. Well... at least partially. I can now get files from the ftp, but cannot put them there. tFTPPut shows error:
Exception in component tFTPPut_1
java.lang.ClassCastException: it.sauronsoftware.ftp4j.FTPClient cannot be cast to com.enterprisedt.net.ftp.FTPClient
at talenddemosjava.testftps_0_1.testFTPS.tFTPPut_1Process(testFTPS.java:385)
at talenddemosjava.testftps_0_1.testFTPS.tFTPConnection_1Process(testFTPS.java:325)
at talenddemosjava.testftps_0_1.testFTPS.runJobInTOS(testFTPS.java:786)
at talenddemosjava.testftps_0_1.testFTPS.main(testFTPS.java:657)

I can see that FTPS is only supported by tFTPget. Is there any other way of putting files on the FTP ? Can anyone tell my when FTPS will be enabled in tFTPput.
One Star

Re: FTPS support

To Solve the ftpes out issue with talend we have found a workaround. Request you to see below link for details:
http://www.osintegration.in/index.php/osi-blogger/item/123-ftpes-put-solved-with-talend
Six Stars

Re: FTPS support

Halidali, definitely thank you for your solution, but I see it as working workaround.
I will not raise the bug as soon as I didn't experience such a behavior, but if you do so, Talend developers will definitely help you, I already solved many bugs with them very quickly.
One Star

Re: FTPS support

Hello Archenroot,
The issue has been already reported to Talend as I can see from the other posts and that is why I have tried to find a workaround solution and I agree it is a workaround only, but I am happy that it is working and so we can still use the fabulous tool for ftpes connections as well.