You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jacopo Cappellato <ja...@gmail.com> on 2016/09/22 13:57:46 UTC

Question about custom JSSEImplementation

Hi all,

I am reviewing some legacy code in Apache OFBiz [*], in the attempt to
simplify its integration with Tomcat 8.0.+ and in preparation to upgrade to
Tomcat 8.5.+.
I have noticed that OFBiz, which starts a Tomcat instance in embedded mode,
uses a legacy class that extends the Tomcat's JSSEImplementation class.
This implementation, in particular, overrides the getServerFactory(...)
method to save an instance of ServerSocketFactory and return it if already
set [**].

Unfortunately I don't know enough about Tomcat internals to understand if
the OFBiz implementation makes any sense: do you have any feedback to share
on how this code could affect the behavior of Tomcat? Maybe a difference in
performance in the setup of an encrypted connection?
As a side note, OFBiz seems to work fine even when I switch to the Tomcat
standard implementation by setting:
sslImplementationName=org.apache.tomcat.util.net.jsse.JSSEImplementation

Thanks in advance,

Jacopo

[*] http://ofbiz.apache.org/

[**] the OFBiz legacy implementation (simplified) of JSSEImplementation:

public class SSLImpl extends JSSEImplementation {
    protected ServerSocketFactory ssFactory = null;

    @Override
    public ServerSocketFactory getServerSocketFactory(AbstractEndpoint
endpoint) {
        if (this.ssFactory == null) {
            this.ssFactory = (new
JSSEImplementation()).getServerSocketFactory(endpoint);
        }
        return ssFactory;
    }
}

Re: Question about custom JSSEImplementation

Posted by Jacopo Cappellato <ja...@gmail.com>.
On Thu, Sep 22, 2016 at 4:07 PM, Mark Thomas <ma...@apache.org> wrote:

>
> It is only used by BIO which has been removed in 8.5.x. Even in 8.0.x I
> don't see anywhere obvious it could help unless you:
> a) set bindOnInit to false
> and
> b) start/stop the connector frequently
>
> In that case, it could speed up the connector start time.
>
> Mark
>

Thank you Mark, your feedback is of great help: we are using NIO connectors
that are started once and we do not set/use bindOnInit so we can probably
just get rid of this old legacy code.

Thank you,

Jacopo

Re: Question about custom JSSEImplementation

Posted by Mark Thomas <ma...@apache.org>.
On 22/09/2016 14:57, Jacopo Cappellato wrote:
> Hi all,
> 
> I am reviewing some legacy code in Apache OFBiz [*], in the attempt to
> simplify its integration with Tomcat 8.0.+ and in preparation to upgrade to
> Tomcat 8.5.+.
> I have noticed that OFBiz, which starts a Tomcat instance in embedded mode,
> uses a legacy class that extends the Tomcat's JSSEImplementation class.
> This implementation, in particular, overrides the getServerFactory(...)
> method to save an instance of ServerSocketFactory and return it if already
> set [**].
> 
> Unfortunately I don't know enough about Tomcat internals to understand if
> the OFBiz implementation makes any sense: do you have any feedback to share
> on how this code could affect the behavior of Tomcat? Maybe a difference in
> performance in the setup of an encrypted connection?

It is only used by BIO which has been removed in 8.5.x. Even in 8.0.x I
don't see anywhere obvious it could help unless you:
a) set bindOnInit to false
and
b) start/stop the connector frequently

In that case, it could speed up the connector start time.

Mark


> As a side note, OFBiz seems to work fine even when I switch to the Tomcat
> standard implementation by setting:
> sslImplementationName=org.apache.tomcat.util.net.jsse.JSSEImplementation
> 
> Thanks in advance,
> 
> Jacopo
> 
> [*] http://ofbiz.apache.org/
> 
> [**] the OFBiz legacy implementation (simplified) of JSSEImplementation:
> 
> public class SSLImpl extends JSSEImplementation {
>     protected ServerSocketFactory ssFactory = null;
> 
>     @Override
>     public ServerSocketFactory getServerSocketFactory(AbstractEndpoint
> endpoint) {
>         if (this.ssFactory == null) {
>             this.ssFactory = (new
> JSSEImplementation()).getServerSocketFactory(endpoint);
>         }
>         return ssFactory;
>     }
> }
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org