Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 362626

Summary: IllegalStateException thrown when SslContextFactory preconfigured with SSLContext
Product: [RT] Jetty Reporter: Matthew Long <mlong8006>
Component: serverAssignee: Jan Bartel <janb>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: janb, jetty-inbox
Version: unspecified   
Target Milestone: 7.5.x   
Hardware: All   
OS: All   
Whiteboard:

Description Matthew Long CLA 2011-11-02 01:19:56 EDT
Build Identifier: 8.0.4.v20111024

I am attempting to set a preconfigured SSLContext on an SslContextFactory to be used when creating SslSelectChannelConnectors.
The doStart method of the SslContextFactory has no behaviour when the factory has had the SSLContext set. This is expected.
However when a created SslSelectChannelConnector (or SslSocketConnector) is started, the SslContextFactory#checkKeyStore method is invoked, which throws an IllegalStateException because the keystore, keystore input stream and keystore path are all null.
I think that either the checkKeyStore method should not be invoked if the SSLContext is not null or should exit early.

This can be worked around by using the SslContextFactory constructor with the keystore path provided but not pointing at a keystore.

Reproducible: Always

Steps to Reproduce:
1. Use the default constructor of the SslContextFactory
2. set a preconfigured SSLContext on the SslContextFactory
3. Construct an SslSelectChannelConnector with the SslContextFactory
4. Start the connector
Comment 1 Jan Bartel CLA 2011-11-20 20:31:21 EST
Fixed for jetty-7.6.0