Skip to content

Commit

Permalink
add documentation for ssl-reload, change exception message in SslCont…
Browse files Browse the repository at this point in the history
…extFactory

Signed-off-by: Lachlan Roberts <[email protected]>
  • Loading branch information
lachlan-roberts committed Jul 15, 2020
1 parent c40ba69 commit 0f7d99c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -989,3 +989,15 @@ As a reminder, when configuring your includes/excludes, *excludes always win*.

Dumps can be configured as part of the `jetty.xml` configuration for your server.
Please see the documentation on the link:#jetty-dump-tool[Jetty Dump Tool] for more information.


==== SslContextFactory KeyStore Reload

Jetty can be configured to monitor the directory of the KeyStore file specified in the SslContextFactory, and reload the
SslContextFactory if any changes are detected to the KeyStore file.

If changes need to be done to other file such as the TrustStore file, this must be done before the change to the Keystore
file which will then trigger the `SslContextFactory` reload.

With the Jetty distribution this feature can be used by simply activating the `ssl-reload` startup module.
For embedded usage the `KeyStoreScanner` should be created given the `SslContextFactory` and added as a bean on the Server.
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ public SSLContext getSslContext()
synchronized (this)
{
if (_factory == null)
throw new IllegalStateException("reload failed SslContext unavailable");
throw new IllegalStateException("SslContextFactory reload failed");

return _factory._context;
}
Expand Down Expand Up @@ -1536,7 +1536,7 @@ public KeyStore getKeyStore()
synchronized (this)
{
if (_factory == null)
throw new IllegalStateException("reload failed KeyStore unavailable");
throw new IllegalStateException("SslContextFactory reload failed");

return _factory._keyStore;
}
Expand All @@ -1560,7 +1560,7 @@ public KeyStore getTrustStore()
synchronized (this)
{
if (_factory == null)
throw new IllegalStateException("reload failed TrustStore unavailable");
throw new IllegalStateException("SslContextFactory reload failed");

return _factory._trustStore;
}
Expand Down

0 comments on commit 0f7d99c

Please sign in to comment.