hi,
i use the org.apache.commons.net.ftp.FTPSClient to develop a ftp client over
SSL.But when execute: ftps.connect("192.168.1.110");    ,There will be some
problems.

please help me! Thanks.

the code :
                String protocol = "TLS";    // SSL/TLS
FTPSClient ftps;
 ftps = new FTPSClient(protocol, true);
 try {
int reply;

ftps.connect("192.168.1.110");
System.out.println("Connected to " + FTP_SERVER + ".");
// After connection attempt, you should check the reply code to verify
// success.
reply = ftps.getReplyCode();

if (!FTPReply.isPositiveCompletion(reply))
{
ftps.disconnect();
System.err.println("FTP server refused connection.");
return;
}
} catch (SocketException e) {
// TODO Auto-generated catch block
Log.e("ftps.connect(FTP_SERVER)----SocketException", e.getMessage());
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
if (ftps.isConnected())
{
try
{
ftps.disconnect();
}
catch (IOException f)
{
// do nothing
}
}
Log.e("ftps.connect(FTP_SERVER)----IOException", e.getMessage());
System.err.println("Could not connect to server.");
e.printStackTrace();
return;
}

the problem:

03-30 12:01:05.980: WARN/System.err(214): Could not connect to server.
03-30 12:01:05.980: WARN/System.err(214): java.io.IOException: Could not
initialize SSL context
03-30 12:01:05.980: WARN/System.err(214):     at
org.apache.commons.net.ftp.FTPSClient.initSslContext(FTPSClient.java:203)
03-30 12:01:05.980: WARN/System.err(214):     at
org.apache.commons.net.ftp.FTPSClient.sslNegotiation(FTPSClient.java:223)
03-30 12:01:05.980: WARN/System.err(214):     at
org.apache.commons.net.ftp.FTPSClient._connectAction_(FTPSClient.java:166)
03-30 12:01:05.980: WARN/System.err(214):     at
org.apache.commons.net.SocketClient.connect(SocketClient.java:178)
03-30 12:01:05.990: WARN/System.err(214):     at
org.apache.commons.net.SocketClient.connect(SocketClient.java:268)
03-30 12:01:05.990: WARN/System.err(214):     at
com.yuxipacific.royalrdc.ftp.FtpsClient.depositWithFtps(FtpsClient.java:66)
03-30 12:01:05.990: WARN/System.err(214):     at
com.yuxipacific.royalrdc.FtpsActivity$FTPConnectThread.run(FtpsActivity.java:61)
03-30 12:01:05.990: WARN/System.err(214): Caused by:
java.security.KeyManagementException: No X509KeyManager found
03-30 12:01:06.000: WARN/System.err(214):     at
org.apache.harmony.xnet.provider.jsse.SSLParameters.<init>(SSLParameters.java:165)
03-30 12:01:06.000: WARN/System.err(214):     at
org.apache.harmony.xnet.provider.jsse.SSLContextImpl.engineInit(SSLContextImpl.java:86)
03-30 12:01:06.000: WARN/System.err(214):     at
org.apache.harmony.xnet.provider.jsse.SSLContextImpl.engineInit(SSLContextImpl.java:66)
03-30 12:01:06.000: WARN/System.err(214):     at
javax.net.ssl.SSLContext.init(SSLContext.java:198)
03-30 12:01:06.010: WARN/System.err(214):     at
org.apache.commons.net.ftp.FTPSClient.initSslContext(FTPSClient.java:201)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to