Hi
I'm getting Java Heap Space when trying to put server's private(!) key as public one
The test came out accidentally when one of the testers took out the private key instead of public.
I know, we are not supposed to use private keys, but still, some validation exception will be nicer than JHS :)
SSHFTPClient sftpClient = new SSHFTPClient();
sftpClient.setRemoteHost(host);
sftpClient.setAuthentication(userName, ePassword);
String pKey = args[0] + " " + args[1];
ByteArrayInputStream str = new ByteArrayInputStream(pKey.getBytes());
try
{
System.out.println("Validating sever public key.");
sftpClient.getValidator().addKnownHost(host, str);
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at com.enterprisedt.net.j2ssh.io.ByteArrayReader.readString(Unknown Source)
at com.enterprisedt.net.j2ssh.transport.publickey.SshPublicKeyFile.toPublicKey(Unknown Source)
at com.enterprisedt.net.ftp.ssh.SSHFTPValidator.addKnownHost(Unknown Source)
BTW, same behavior for 2.0.1 and 3.0.2 edtFTPj/PRO versions