Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-16743: Auto reload keystore/truststore on change #2100

Merged
merged 15 commits into from Nov 30, 2023

Conversation

tflobbe
Copy link
Member

@tflobbe tflobbe commented Nov 28, 2023

Marking this as a draft for now, since it's missing the documentation changes. Also, I wasn't able to test the Windows start script changes

@@ -279,12 +282,20 @@ public void init(PluginInfo info) {
int soTimeout =
getParameter(args, HttpClientUtil.PROP_SO_TIMEOUT, HttpClientUtil.DEFAULT_SO_TIMEOUT, sb);

int keystoreReloadIntervalSecs =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be handled on the Http2SolrClient (and HttpSolrClient) itself, kind of like the keystore/truststore/etc are configured through sysProps by default. There are numerous usages of Solr clients throughout Solr, and presumably, all of them would need to offer this. (Though I know most are short-lived).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine either way. I didn't like much to "leak" the server-side system properties into the client, but it's true that it's what we doing with other settings, so maybe better to favor consistency.
I did explicitly disabled this for some of those short-lived clients to prevent them from starting and stopping the scanner.
Also, I was missing the setting for the update client, this new code you suggested is handling that. Added a test for it

Copy link
Contributor

@HoustonPutman HoustonPutman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, all it needs is some docs! Love that this is finally making it in!

SOLR_URL_SCHEME=https
if [ -n "$SOLR_SSL_KEY_STORE" ]; then
SOLR_SSL_OPTS+=" -Dsolr.jetty.keystore=$SOLR_SSL_KEY_STORE"
if [ "${SOLR_SSL_RELOAD_ENABLED:-true}" == "true" ] && [ "${SOLR_SECURITY_MANAGER_ENABLED:-true}" == "true" ]; then
# In this case we need to allow reads from the parent directory of the keystore
SOLR_SSL_OPTS+=" -Dsolr.jetty.keystoreParentPath=$SOLR_SSL_KEY_STORE/.."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to expand this out? I'm surprised the security manager works with /..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, without this, the tests with SSL + Security Manager will fail. I believe the reason is that the KeyStoreScanner uses the parent file here

@tflobbe tflobbe merged commit 9f21a71 into apache:main Nov 30, 2023
5 checks passed
@tflobbe tflobbe deleted the solr-16743 branch November 30, 2023 21:59
tflobbe added a commit that referenced this pull request Dec 1, 2023
Add Jetty module to scan and automatically reload key store and trust store changes. Also, add scanner to the SolrJ library to do the same on the client side if configured
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants