0

When I am using this ftps setting

<property name="cipherSuites" value="a,b.c"/>

I am getting exception

org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.IllegalStateException: failed to create FTPClient]
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)
* Nested Exception (Underlying Cause) ---------------
java.lang.IllegalStateException: failed to create FTPClient
    at com.sapienter.jbilling.server.mediation.sourcereader.AbstractRemoteFileRetriever.copyToLocalFileSystem(AbstractRemoteFileRetriever.java:131)
    at com.sapienter.jbilling.server.mediation.sourcereader.FtpsFileRetriever.copyToLocalFileSystemFrom(FtpsFileRetriever.java:96)
    at com.sapienter.jbilling.server.process.task.FtpRemoteCopyTask.execute(FtpRemoteCopyTask.java:91)
    at com.sapienter.jbilling.server.process.task.FileExchangeTriggerTask.doExecute(FileExchangeTriggerTask.java:43)
    at com.sapienter.jbilling.server.process.task.ScheduledTask.execute(ScheduledTask.java:107)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)
Caused by: java.lang.IllegalArgumentException: Unsupported ciphersuite a
    at com.sun.net.ssl.internal.ssl.CipherSuite.valueOf(CipherSuite.java:184)
    at com.sun.net.ssl.internal.ssl.CipherSuiteList.<init>(CipherSuiteList.java:69)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.setEnabledCipherSuites(SSLSocketImpl.java:2162)
    at org.apache.commons.net.ftp.FTPSClient.sslNegotiation(FTPSClient.java:258)
    at org.apache.commons.net.ftp.FTPSClient._connectAction_(FTPSClient.java:205)
    at org.apache.commons.net.SocketClient.connect(SocketClient.java:169)
    at org.apache.commons.net.SocketClient.connect(SocketClient.java:189)

This is my configuration setting

<bean id="ftpsDefaultSessionFactory" class="org.springframework.integration.ftp.session.DefaultFtpsSessionFactory"           scope="prototype">
        <property name="host" value="127.0.0.1"/>
        <property name="port" value="22"/>
        <property name="username" value="ftpuser"/>
        <property name="password" value="neeraj"/>
        <property name="clientMode" value="2"/>
        <property name="fileType" value="2"/>
        <property name="useClientMode" value="true"/>
        <property name="cipherSuites" value="a,b.c"/>
        <property name="keyManager" ref="keyManager"/>
        <property name="trustManager" ref="trustManager"/>
        <property name="wantsClientAuth" value="false"/>
        <property name="needClientAuth" value="true"/>
        <property name="sessionCreation" value="true"/>
        <!--<property name="authValue" value="neeraj"/>-->
        <property name="protocol" value="SSL"/>
        <property name="prot" value="P"/>
        <property name="implicit" value="false"/>
         <property name="protocols" value="SSL, TLS"/>
    </bean>

I am refer these setting from http://docs.spring.io/spring-integration/reference/html/ftp.html.

Are any one have any idea, how I will resolve this issue ?

Neeraj Bhatt
  • 145
  • 2
  • 13

2 Answers2

1

<property name="cipherSuites" value="a,b.c"/>

They are not real cypher suites, that doc is just showing available properties and not real values for them.

You generally don't need to supply that property unless you have specific requirements.

Gary Russell
  • 166,535
  • 14
  • 146
  • 179
1

Refer to org.apache.commons.net.ftp.FTPSClient API and document and you should be able to configure DefaultFtpsSessionFactory properly. Prefer to use defaults in creating an FTPSClient instance and you probably won't be needing all those other properties being set in DefaultFtpsSessionFactory.

aalmero
  • 345
  • 2
  • 18