We get an java.security.NoSuchAlgorithmException when we run ftpsClient.connect() on java7 (HotSpot jdk1.7.0_07) on Solaris. The same code works just fine on java7 on Windows 7 and on Linux with the same jdk-version.
Here is a small testprogram which works in Windows and Linux, but falls flat on Solaris:
public static void main(String[] args) {
try {
SSLFTPClient client = new SSLFTPClient();
client.setRemoteHost(host);
client.setRemotePort(port);
client.setConnectMode(FTPConnectMode.PASV);
client.setImplicitFTPS(true);
client.getRootCertificateStore().importPEMFile(pemFilePath);
client.setValidateServer(true);
SSLFTPStandardValidator.MAX_CERTIFICATE_CHAIN_LENGTH = 3;
SSLFTPStandardValidator sslftpStandardValidator = new SSLFTPStandardValidator(commonName);
client.setCustomValidator(sslftpStandardValidator);
System.out.println("Connecting to " + client.getRemoteHost() + ":" + client.getRemotePort());
client.connect();
System.out.println("Connection established, running auth");
client.auth(SSLFTPClient.PROT_PRIVATE);
System.out.println("Auth ok, attempt login.");
client.login(user, passwd);
System.out.println("Login ok, listing directories");
String[] dirs = client.dir();
System.out.println("Directories (" + dirs.length + "):");
for (String dir : dirs) {
System.out.println(dir);
}
} catch (SSLFTPCertificateException e) {
e.printStackTrace();
e.printCertificates();
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
The following exception is thrown when
client.connect() is called:
java.security.NoSuchAlgorithmException: algorithm RSA/ECB/PKCS1Padding is not available from provider CryptixEDT
at xjava.security.IJCE.a(IJCE.java:506)
at xjava.security.IJCE.getImplementationClass(IJCE.java:452)
at xjava.security.IJCE.getImplementation(IJCE.java:405)
at xjava.security.Cipher.b(Cipher.java:535)
at xjava.security.Cipher.getInstance(Cipher.java:482)
at com.enterprisedt.net.puretls.i.a(SSLClientKeyExchange.java:75)
at com.enterprisedt.net.puretls.m.a(SSLHandshake.java:222)
at com.enterprisedt.net.puretls.m.a(SSLHandshake.java:217)
at com.enterprisedt.net.puretls.n.l(SSLHandshakeClient.java:309)
at com.enterprisedt.net.puretls.n.c(SSLHandshakeClient.java:142)
at com.enterprisedt.net.puretls.m.a(SSLHandshake.java:168)
at com.enterprisedt.net.puretls.j.a(SSLConn.java:161)
at com.enterprisedt.net.puretls.SSLSocket.internalSocket(SSLSocket.java:116)
at com.enterprisedt.net.puretls.SSLSocket.<init>(SSLSocket.java:69)
at com.enterprisedt.net.ftp.ssl.SSLFTPClient.connect(SSLFTPClient.java:853)
at example.FtpsAttempt.main(FtpsAttempt.java:33)
Exception in thread "main" java.lang.InternalError: java.security.NoSuchAlgorithmException: algorithm RSA/ECB/PKCS1Padding is not available from provider CryptixEDT
at com.enterprisedt.net.puretls.i.a(SSLClientKeyExchange.java:100)
at com.enterprisedt.net.puretls.m.a(SSLHandshake.java:222)
at com.enterprisedt.net.puretls.m.a(SSLHandshake.java:217)
at com.enterprisedt.net.puretls.n.l(SSLHandshakeClient.java:309)
at com.enterprisedt.net.puretls.n.c(SSLHandshakeClient.java:142)
at com.enterprisedt.net.puretls.m.a(SSLHandshake.java:168)
at com.enterprisedt.net.puretls.j.a(SSLConn.java:161)
at com.enterprisedt.net.puretls.SSLSocket.internalSocket(SSLSocket.java:116)
at com.enterprisedt.net.puretls.SSLSocket.<init>(SSLSocket.java:69)
at com.enterprisedt.net.ftp.ssl.SSLFTPClient.connect(SSLFTPClient.java:853)
at example.FtpsAttempt.main(FtpsAttempt.java:33)
The kicker is that the same code works on Solaris if I run with jdk1.6.0_32.
Any help would be very much appreciated.
/Anders