hi
FYI from Camel doc :
preferredAuthentications
SFTP only: Camel 2.10.7, 2.11.2,2.12.0: set the preferred authentications which
SFTP endpoint will used. Some example include:password,publickey. If not
specified the default list from JSCH will be used.
from JSCH doc :
User Authentication methods (UserAuth)
Here the user sends a list of methods, and we have a list of methods in the
option PreferredAuthentications (in preference order). We take the first of our
methods which is supported by the server, get the userauth.method variable to
load the implementing class, and try to authenticate. This will repeat until we
are authenticated or no more methods left.
The following ones are built in:
userauth.none
mainly for getting the list of methods the server supports.
userauth.password
usual password authentication.
userauth.keyboard-interactive
Using the generic message exchange authentication mechanism, as defined in
RFC 4256.
userauth.publickey
public key authentication, using an Identity.
userauth.gssapi-with-mic
Using the GSS-API (see below) as defined in RFC 4462, section 3.
I don't know your full context. You should check SFTP config to force publickey
too.
With this I think you could remove your workaround.
For the second reconnect and the error, I can't explain yet sorry :-(
Greg AUTRIC
JBoss Middleware Consultant
email : gautric __at__ redhat __dot__ com
twitter : @gautric_io
----- Mail original -----
De: "yeandone" <[email protected]>
À: [email protected]
Envoyé: Mercredi 25 Mars 2015 18:00:56
Objet: Re: SFTP connection issue with private key
Hi, Greg.
Thank you so much for your reply! In my camel route, I did not specify any
preferredAuthentications. Our route runs twice a day. Can you explain why it
threw the exception after a long period time of inactive connectivity (the
first run) and the re-connection worked after a few hours (the second run).
Our system admin yesterday developed a workaround by writing a script to
ping/connect the SFTP server from prod server every 2 hours and the issue
seemed to be resolved. But we do not want to stick to this workaround. So I
am trying to understand what exactly is causing exception and fix it.
Route:
<from
uri="{{sftpLocation}}?privateKeyFile={{location}}&sendEmptyMessageWhenIdle=true&idempotent=false&consumer.bridgeErrorHandler=true&disconnect=false&maximumReconnectAttempts=2&filter=#customFileFilter"/>