You have a mule application that uses the SFTP connector 2.0.0 version and above (Apache mina library is used) and the authentication is the "PUBLIC_KEY" method using Identity File in .ppk format. The app fails with the below warning if the preferredAuthenticationMethods="#[['PUBLIC_KEY']]"
org.mule.runtime.api.connection.ConnectionException: Could not establish SFTP connection with host: '<host>' at port: '<port>' - No more authentication methods available Caused by: org.mule.extension.sftp.internal.exception.SftpConnectionException: Could not establish SFTP connection with host: '<host>' at port: '<port>' - No more authentication methods available Caused by: org.mule.runtime.extension.api.exception.ModuleException: org.apache.sshd.common.SshException: No more authentication methods available Caused by: org.apache.sshd.common.SshException: No more authentication methods available
And fails with the below error if nothing is specified in the "preferredAuthenticationMethods".
Error was: Could not establish SFTP connection with host: '' at port: '22' - [ssh-connection]: Failed to get operation result within specified timeout: 10000 msec org.mule.runtime.api.connection.ConnectionException: Could not establish SFTP connection with host: '' at port: '22' - [ssh-connection]: Failed to get operation result within specified timeout: 10000 msec Caused by: org.mule.extension.sftp.internal.exception.SftpConnectionException: Could not establish SFTP connection with host: '' at port: '22' - [ssh-connection]: Failed to get operation result within specified timeout: 10000 msec Caused by: org.mule.runtime.extension.api.exception.ModuleException: org.apache.sshd.common.SshException: [ssh-connection]: Failed to get operation result within specified timeout: 10000 msec Caused by: org.apache.sshd.common.SshException: [ssh-connection]: Failed to get operation result within specified timeout: 10000 msec
Below is the configuration used.
<sftp:config name="SFTP_Config" doc:name="SFTP Config" doc:id="34cf9b32-d3de-4171-b6e9-36dc0b25e7c0" >
<sftp:connection host="${host}" username="${user}" identityFile="${app.home}/${file-ppk}" passphrase="${pwd}" port="${port}" workingDir="${root-folder}" preferredAuthenticationMethods="#[['PUBLIC_KEY']]">
</sftp:connection>
</sftp:config>
This is due to the limitation with the Apache mina library which doesn't work with the .ppk file format. Our connector documentation also mentions that ssh-keygen’s OpenSSH PKI format is not accepted.
https://docs.mulesoft.com/sftp-connector/latest/sftp-documentation#config_connection
An identity file location for a PKI private key. ssh-keygen’s OpenSSH PKI format is not accepted. You can use argument "-m PEM".
Download PuTTYgen: If you don't have PuTTYgen installed, you can download it as part of the PuTTY suite from the official website: PuTTY Download Page https://www.putty.org/ Open PuTTYgen: Run PuTTYgen. Click on the "Load" button. Load the .ppk Private Key: In the file dialog, select the option to display files with all extensions. Locate and select your .ppk private key file. Click "Open." Convert and Save as PEM: Once the .ppk file is loaded, click on the "Conversions" menu. Choose "Export OpenSSH Key." Save the file with a .pem extension.
001117275

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.