|
我的系统是rhel4,找的了virgoftp,感觉不错,不过一开始用就遇到了问题,
只好下了virgoftp_1.3.5.1_source来看看
1.
访问内部一个Serve-U的STL/SSL 的ftp站点时候
chain[0]: OU=Software, [email protected], C=US, O=RhinoSoft.com, ST=WI, L=Helenville, CN=ftp.Serv-U.com
javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:166)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:151
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1485)
Hi, I had the same problem and this is the way I solved it:
我发现是没有找到cert文件,于是指定了jre1.5的cacerts
但是接着就发现password错误,原来程序指定了cert的password 为
virgoftp
不得已,修改了Resource.java的
public static String keystorePassword = "changeit";
认证过去了。
2.到了PASV以后,LIST 就会死掉。
后台有错误
Exception in thread "main" java.lang.IllegalArgumentException: Argument not valid
at org.eclipse.swt.SWT.error(SWT.java:335
at org.eclipse.swt.SWT.error(SWT.java:3297)
at org.eclipse.swt.SWT.error(SWT.java:326
at org.eclipse.swt.custom.StyledText.setStyleRanges(StyledText.java:7764)
at org.eclipse.swt.custom.StyledText.setStyleRange(StyledText.java:7646)
at edu.sysu.virgoftp.gui.LoggerHandle$1.run(Unknown Source)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:152)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:3711)
at edu.sysu.virgoftp.gui.LoggerHandle.log(Unknown Source)
at edu.sysu.virgoftp.ftp.FTPControlSocket.getResponse(Unknown Source)
at edu.sysu.virgoftp.ftp.FTPControlSocket.sendCmd(Unknown Source)
at edu.sysu.virgoftp.ftp.FTPConnection.sendRawCmd(Unknown Source)
at edu.sysu.virgoftp.ftp.FTPClient.sendRawCommand(Unknown Source)
at edu.sysu.virgoftp.gui.FtpEngine.sendRawCommand(Unknown Source)
at edu.sysu.virgoftp.gui.VirgoFTP$15.widgetSelected(Unknown Source)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3155)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2835)
at edu.sysu.virgoftp.gui.VirgoFTP.open(Unknown Source)
at edu.sysu.virgoftp.gui.VirgoFTP.main(Unknown Source)
看了一下FTPDataSocket.java,发现是用PASV返回的ip地址去建立socket连接,而这个时候其实应该有一个
Substituting received PASV address o server address 的步骤,
我个人认为程序就在在这里卡住了。
所以修改了FTPDataSocket.java
在initPasvSocket(ip,port);
前面增加了一个ip =new StringBuffer(ctlsocket.getHost());
在FTPControlSocket.java增加了一个getHost的方法。
如此以后,virgoftp成功!
以上修改因为是针对一个内部的ftp来作的,最后好用了。
十分感谢作者的辛苦劳动和共享精神,希望提出这两个问题能够对virgoftp有所帮助! |
|