commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] [Commented] (NET-326) A KeyManager is required when the protection level is set to 'P' with FTPSClient on active mode
Date Mon, 21 Mar 2011 02:59:06 GMT


Sebb commented on NET-326:

With the new KeyManagerUtils class, the code becomes:

FTPSClient cl = new FTPSClient();

KeyStore ks = KeyManagerUtils.createKeyStore("JKS","/path/to/privatekeystore.jks","storepassword");
KeyManager km = KeyManagerUtils.createClientKeyManager(ks, "privatekeyalias", "keypassword");

// If the FTP server certificate is not trusted by the JVM, add this:
X509TrustManager tm = TrustManagerUtils.getAcceptAllTrustManager();


The new class is slightly different from the original solution, as it does not use an explicit
SSLContext to initialise the FTPSClient, nor does it use the KeyManagerFactory. This allows
it to use the setKeyManager/setTrustManager methods.

> A KeyManager is required when the protection level is set to 'P' with FTPSClient on active
> -----------------------------------------------------------------------------------------------
>                 Key: NET-326
>                 URL:
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 2.0
>         Environment: Windows XP profesional service pack 2, Java Java 1.6.0_12-b04 
>            Reporter: Terence Dudouit
>         Attachments:
> Using a simple FTPS client that list a directory, when execPROT("P") is set and the active
mode is on, the following exception is thrown :
> No available certificate or key corresponds to the SSL cipher
suites which are enabled.
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at fr.enovacom.eai.actions.dynamiques.protocole.ftp.FTPGet.testFTPS(
> 	at fr.enovacom.eai.actions.dynamiques.protocole.ftp.FTPGet.main(
> This doesn't occur on passive mode.
> The only way to make it work is to set a keyManager although there is no need for a client

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message