Claus,

I have now tested my version using both passive and active (which requires a
certificate) mode. I've tested against a free ftp server - Filezilla - and a
commercial ftp server (that we often use) - Serv-u. It works fine.

I haven't tested your version yet because it requires me to build my
application against Camel version 2.4-SNAPSHOT instead of Camel version
2.3.0. To get this to work I need to get all the 2-4-SNAPSHOT artifacts into
my local Maven repository. I tried to do this by building Camel locally but
I never seem to get it to build. Right now, I'm stuck with the following
Maven error message (I'm usng Maven 2.0.11):

[INFO] Writing OBR metadata
[INFO]
------------------------------------------------------------------------
[INFO] Building Camel :: Jetty
[INFO]    task-segment: [clean, install]
[INFO]
------------------------------------------------------------------------
[INFO] [clean:clean]
Downloading:
https://repository.apache.org/content/repositories/releases//com/su
n/mail/all/1.4.3/all-1.4.3.pom
[INFO] Unable to find resource 'com.sun.mail:all:pom:1.4.3' in repository
apache
.releases (https://repository.apache.org/content/repositories/releases/)
Downloading:
http://svn.apache.org/repos/asf/servicemix/m2-repo/com/sun/mail/all
/1.4.3/all-1.4.3.pom
[INFO] Unable to find resource 'com.sun.mail:all:pom:1.4.3' in repository
servic
emix (http://svn.apache.org/repos/asf/servicemix/m2-repo)
Downloading:
http://jansi.fusesource.org/repo/release/com/sun/mail/all/1.4.3/all
-1.4.3.pom
[INFO] Unable to find resource 'com.sun.mail:all:pom:1.4.3' in repository
jansi.
release.m2 (http://jansi.fusesource.org/repo/release)
Downloading:
http://repository.ops4j.org/maven2/com/sun/mail/all/1.4.3/all-1.4.3
.pom
[INFO] Unable to find resource 'com.sun.mail:all:pom:1.4.3' in repository
ops4j
(http://repository.ops4j.org/maven2)
Downloading:
http://repo1.maven.org/maven2/com/sun/mail/all/1.4.3/all-1.4.3.pom
[INFO] Unable to find resource 'com.sun.mail:all:pom:1.4.3' in repository
centra
l (http://repo1.maven.org/maven2)
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: javax.mail:mail:jar:null

Reason: Cannot find parent: com.sun.mail:all for project:
javax.mail:mail:jar:nu
ll for project javax.mail:mail:jar:null


[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 4 minutes 26 seconds
[INFO] Finished at: Mon Jun 07 12:59:05 CEST 2010
[INFO] Final Memory: 231M/483M
[INFO]
------------------------------------------------------------------------


/Bengt

2010/6/5 Bengt Rodehav <be...@rodehav.com>

> God you're fast. I made my own attempts and attached diff files to the JIRA
> issue you created. I also added a couple of comments/suggestions to the
> issue.
>
> In short I believe that it is probably easier for the user/developer if it
> is enough to specify whether a secure data channel should be used or not
> (the default should be true). Adding more detailed options, like you did, is
> of course just a benefit as long as it is possible to also configure it the
> easy way (like I described).
>
> I haven't tested your changes yet - will do. I have done some limited
> testing with my own version, but only in passive mode. If you use a secure
> data channel in active mode one must first create a public/private key pair
> for the ftps client to use and I haven't gotten around to testing that yet.
>
> /Bengt
>
> 2010/6/4 Claus Ibsen <claus.ib...@gmail.com>
>
>> Hi
>>
>> On Fri, Jun 4, 2010 at 3:42 PM, Bengt Rodehav <be...@rodehav.com> wrote:
>> > OK, will try to do that sometime this weekend.
>> >
>> > Will be in touch,
>> >
>>
>> I was one step ahead of you. I created the ticket and took a stab at
>> resolving it.
>> https://issues.apache.org/activemq/browse/CAMEL-2790
>>
>> Can you try with the latest source code? And maybe if there is still
>> some issue then work on a patch from there.
>> Would be lovely with an unit test, but the test ftp server we use
>> cannot understand the secure data transfer.
>>
>> Anyway would be awesome if you could test it on your real systems.
>>
>>
>>
>> > /Bengt
>> >
>> > 2010/6/4 Claus Ibsen <claus.ib...@gmail.com>
>> >
>> >> Hi
>> >>
>> >> Well spotted. Do you mind creating a JIRA ticket and link to this post
>> >> using nabble etc.
>> >> And you may even want to contribute a patch :)
>> >>
>> >>
>> >> On Fri, Jun 4, 2010 at 11:34 AM, Bengt Rodehav <be...@rodehav.com>
>> wrote:
>> >> > I'm using camel-ftp for secure ftps communication. I need to be able
>> to
>> >> > connect to a wide range of ftps servers in both explicit and implicit
>> >> mode.
>> >> > I have encountered problems using camel-ftp for ftps communication in
>> >> > implicit mode.
>> >> >
>> >> > Some ftps servers require that the file transfer is encrypted (not
>> just
>> >> the
>> >> > commands). This is of course very natural and is the reason why ftps
>> is
>> >> > chosen in the first place. However, commons-net (which camel-ftp
>> uses)
>> >> does
>> >> > (for some reason) not by default setup a secure channel for file
>> >> transfers.
>> >> > It has to be requested by code similar to the following:
>> >> >
>> >> >  ftpsClient.execPBSZ(0);
>> >> >  ftpsClient.execPROT("P");
>> >> >
>> >> > I suggest to add an option to camel-ftp, regarding ftps, to make it
>> >> possible
>> >> > to specify whether the data channel will be encrypted or not.
>> Encrypted
>> >> > should be default.
>> >> >
>> >> > When looking at the code in camel-ftp it seems like there is no
>> special
>> >> > handling during connect for ftps compared to ftp. Thus there is no
>> >> natural
>> >> > place to put the above code. One way is to add something like the
>> >> following
>> >> > at the end of the method "connect" in the class "FtpOperations":
>> >> >
>> >> >  if(client instanceof FTPSClient) {
>> >> >    FTPSClient ftpsClient = (FTPSClient)client;
>> >> >    try {
>> >> >      if (useSecureDataChannel) { // useSecureDataChannel should be
>> >> > initialized from the configuration somehow
>> >> >        ftpsClient.execPBSZ(0);
>> >> >        ftpsClient.execPROT("P");
>> >> >      }
>> >> >    } catch (SSLException e) {
>> >> >      throw new
>> GenericFileOperationFailedException(client.getReplyCode(),
>> >> > client.getReplyString(), e.getMessage(), e);
>> >> >    } catch (IOException e) {
>> >> >      throw new
>> GenericFileOperationFailedException(client.getReplyCode(),
>> >> > client.getReplyString(), e.getMessage(), e);
>> >> >    }
>> >> >  }
>> >> >
>> >> > Am I the only one having problems with this? Maybe there is a
>> workaround
>> >> > that I haven't figured out.
>> >> >
>> >> > /Bengt
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Claus Ibsen
>> >> Apache Camel Committer
>> >>
>> >> Author of Camel in Action: http://www.manning.com/ibsen/
>> >> Open Source Integration: http://fusesource.com
>> >> Blog: http://davsclaus.blogspot.com/
>> >> Twitter: http://twitter.com/davsclaus
>> >>
>> >
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>
>

Reply via email to