Skip to content

Allow separate truststore conf for HttpEmitter#5298

Merged
himanshug merged 2 commits intoapache:masterfrom
jon-wei:http_emitter_ssl
Jan 26, 2018
Merged

Allow separate truststore conf for HttpEmitter#5298
himanshug merged 2 commits intoapache:masterfrom
jon-wei:http_emitter_ssl

Conversation

@jon-wei
Copy link
Copy Markdown
Contributor

@jon-wei jon-wei commented Jan 25, 2018

This PR allows the HttpEmitter and ParametrizedUriEmitter to use a different SSLContext from the one injected by the logic introduced in #4270.

The HttpEmitter can use the default Java SSLContext or a truststore specified through configuration.

This can be useful in situations where it's inconvenient or forbidden by policy to keep all certificates in the same truststore.

For example, suppose the server certificate used by Druid nodes for internal communications is signed by a root cert that is not present in the default Java truststore, but the metrics receiver uses a certificate signed by a major CA, which is present in the default Java truststore, and the user wishes to keep the non-major CA signed cert in a separate truststore.

return effectiveSSLContext;
}

public static SSLContext getSSLContextFromConfig(HttpEmitterSSLClientConfig config)
Copy link
Copy Markdown
Contributor

@himanshug himanshug Jan 25, 2018

Choose a reason for hiding this comment

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

looks pretty much same as SSLContextProvider.get(). Can we refactor the code a bit and create a static method in SSLContextProvider that could be used here ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I moved this block to a utility class, SSLContextProvider is in an extension

@himanshug himanshug merged commit f6749f1 into apache:master Jan 26, 2018
jon-wei added a commit to implydata/druid-public that referenced this pull request Jan 26, 2018
* Fix HttpEmitter TLS support, allow separate truststore conf

* PR comment, fix tests
@dclim dclim added this to the 0.13.0 milestone Oct 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants