2 Replies Latest reply on May 25, 2006 9:06 AM by mazz

    extending SSLSocketBuilder - need methods to be protected

    mazz

      This is a request for enhancement.

      Can we make the private methods in SSLSocketBuilder protected to help facilitate subclassing?

      I think I still need to customize the SSL stuff even further, but I don't want to have to re-write or cut-n-paste that which is already implemented in SSLSocketBuilder.

      I envision being able to override createCustomServerSocketFactory and createCustomSocketFactory in my subclass to do some additional things with the SSLContext and possibly wrapping the factories in my own implementation, along the same lines as what UserModeSSLServerSocketFactory is doing (i.e. I may want access to the actual sockets that get created).

      I think the following private methods should be made protected:

      createCustomServerSocketFactory
      createCustomSocketFactory
      getTrustManagerFactory
      getKeyManagerFactory
      getKeyStore

        • 1. Re: extending SSLSocketBuilder - need methods to be protecte
          mazz
          • 2. Re: extending SSLSocketBuilder - need methods to be protecte
            mazz

            Another reason why this is needed - I may want to enable the setWantClientAuth or setNeedClientAuth to enabled/disable client authentication. The only way to do this is have my own UserModeSSLServerSocketFactory-like class.

            Actually, this might be something we can add directly in the Builder class now. Add setWantClientAuth and setNeedClientAuth methods on Builder and, just like what happens today with the useClientMode, the UserModeSSLServerSocketFactory class sets the flag on the socket.

            BTW: there is a client-mode, want-client-auth and need-client-auth settings on SSLSockets as well. But Builder doesn't have a way to set those (there is no analogous UserModeSSLServerSocketFactory for the SSLSocketFactory).

            To make Builder as customizable as possible, wouldn't it need to allow for that?