You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ftpserver-users@mina.apache.org by Jeroen Cranendonk <je...@sdu-identification.nl> on 2008/09/08 11:59:49 UTC

Twice SSLContext.getInstance(protocol) ?

Hi!

This is in slightly older code, so might already be fixed (can't check from
my workplace).

In DefaultSslConfiguration I find:
        // create SSLContext
>>>>        ctx = SSLContext.getInstance(protocol);
        
        KeyManager[] keyManagers = keyManagerFactory.getKeyManagers();

        // wrap key managers to allow us to control their behavior
(FTPSERVER-93)
        for (int i = 0; i < keyManagers.length; i++) {
          if(ClassUtils.extendsClass(keyManagers[i].getClass(),
"javax.net.ssl.X509ExtendedKeyManager")) {
        	  keyManagers[i] = new
ExtendedAliasKeyManager(keyManagers[i], keyAlias);
          } else if(keyManagers[i] instanceof X509KeyManager) {
        	  keyManagers[i] = new AliasKeyManager(keyManagers[i],
keyAlias);
          }
        } 
        
        // create SSLContext
>>>>        ctx = SSLContext.getInstance(protocol);

Looks to me like ctx gets initialized twice with no good reason :)

If this is already fixed, ignore me ;)

Cheers!
Jeroen




_______________________________________________________________________________________________
Help save paper! Do you really need to print this email?

Aan de inhoud van dit bericht kunnen alleen rechten ten opzichte van Sdu Identification B.V.
worden ontleend, indien zij door rechtsgeldig ondertekende stukken worden ondersteund.
De informatie in dit e-mailbericht is van vertrouwelijke aard en alleen bedoeld voor gebruik
door geadresseerde. Als u een bericht onbedoeld heeft ontvangen, wordt u verzocht de
verzender hiervan in kennis te stellen en het bericht te vernietigen zonder te vermenigvuldigen
of andersoortig te gebruiken.

The contents of this electronic mail message are only binding upon Sdu Identification B.V.,
if the contents of the message are accompanied by a lawfully recognized type of signature.
The contents of this electronic mail message are privileged and confidential and are intended
only for use by the addressee. If you have received this electronic mail message by error,
please notify the sender and delete the message without reproducing it and using it in any way.


Re: Twice SSLContext.getInstance(protocol) ?

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On 9/8/08, Jeroen Cranendonk <je...@sdu-identification.nl> wrote:
>  Looks to me like ctx gets initialized twice with no good reason :)

It's still in there. While doing no harm (besides the performance
issue calling the factory twice) it's still useless. I'll get rid of
it when I'm back home. Thanks!

/niklas