https://bz.apache.org/bugzilla/show_bug.cgi?id=62032

            Bug ID: 62032
           Summary: NPE caused by Connector and SSLHostConfig
           Product: Tomcat 9
           Version: 9.0.2
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Util
          Assignee: dev@tomcat.apache.org
          Reporter: csuth...@redhat.com
  Target Milestone: -----

This behavior was noted on a users list thread, but I think a BZ is in order to
make a more useful message for users.

Here is the Connector and SSLHostConfig that causes the problem:

~~~
    <Connector port="8443"
protocol="org.apache.coyote.http11.Http11NioProtocol"
               maxThreads="150" SSLEnabled="true" sslProtocol="TLS">
        <SSLHostConfig hostName="test">
            <Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
                         type="RSA" />
        </SSLHostConfig>
    </Connector>
~~~

The issue is that we're using sslProtocol on the Connector (which creates a
_default_ SSLHostConfig object; this could be any SSLHostConfig attribute) AND
defining an SSLHostConfig (with a name other than _default_ so they don't
clash). This causes the _default_ SSLHostConfig object to be created which then
tries to use a non-existent default PEM file and throws the NPE. The user knows
nothing of this and is confused because they provided a certificateKeystoreFile
in the configuration above, not a PEM file.

We need to catch and wrap this NPE in something more informative.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to