Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.3k views
in .NET FTP by (560 points)
I get an error trying to connect to OpenSSH on Windows.
I used the sample program in Ex6_SFTPClient and it works.

I have the jar files loaded in the class path, but do I need all of the other files, the keys and such. The reason I ask is because in the sample program, I renambed all of the files except for the .class and .bat file, and it still ran with no problems (I guess because host validation is off?)

The IOException error I'm getting is: RSA KeyFactory not available

Here's the code:
public boolean connect(String sServer, String sUserName, String sPassword)
   {         
      try
      {      
         // set remote host
         ftp.setRemoteHost( sServer);
   
         System.out.println( " Setting user-name and password");      
         ftp.setAuthentication( sUserName, sPassword);
   
         System.out.println( " Turning off server validation");      
         ftp.getValidator().setHostValidationEnabled( false);
   
         // connect to the server
         System.out.println( " Connecting to server");      
         ftp.connect();      
         
         bConnected = true;
         return true;
      }
      catch(FTPException ex)
      {         
         System.out.println( "FTPError Connecting. " + ex.getMessage());
      }
      catch(IOException ex)
      {
         System.out.println( "IOError Connecting. " + ex.getMessage());         
      }
      
      return false;
   }

5 Answers

0 votes
by (162k points)
There are three examples in that directory - the keys are example ones for SFTPKeyAuth.java.

You should be copying SFTPPasswordAuth.java as it looks like you are using password authentication.

Make sure your CLASSPATH is picking up both your modified class, the license.jar and edtftpj-pro.jar.

If the example works you should be able to get yours working by exactly copying it.
0 votes
by (560 points)
I should mention that I'm using WSAD for development... I have the classpath set correctly, but in Websphere, it will not work. I just tried and the same code on the command line it works fine, though. So what I've been doing is blindly coding in WSAD without testing and assumming it will work... Do you support websphere?
0 votes
by (51.6k points)
Yes, other customers are using our software with WebSphere. What problem are you encountering? It might be worthwhile copying your code into a standalone application to see if the problem is related to Websphere or some other problem.

- Hans (EDT)
0 votes
by (560 points)
Again, it does work fine on the command line. But in WSAD, I get:

RSA KeyFactory not available as an IOException when I make the connect() call.
0 votes
by (51.6k points)
Sorry, I should have read the whole thread more carefully before replying. This sort of error is usually related to incorrect security providers being loaded. Is it possible for you to enable logging and post resulting log here or e-mailing it to support?

- Hans (EDT)

Categories

...