-
Notifications
You must be signed in to change notification settings - Fork 34
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
HTTPS Configuration Considered Extremely Difficult #10
Comments
I would love a patch. Manticore is basically just scratching my itch right now, so I'm sanding off rough edges as I find them. This sounds like one that needs some sanding! :) |
@cheald do you have any preference on key names for SSL-related settings? I considered moving all SSL-related options into a nested hash under options[:ssl], but that is somewhat invasive WRT the current verification-related flag. |
I think it would be appropriate to move them into an Manticore is still young and not widely used yet, so it's fine to make breaking changes as long as they're done as elegantly as possible. |
I'll go ahead and pull it in so that @synhaptein gets credit for it. :) |
Thanks! |
I've added support for additional options via Notably, these include |
I've just added support for client cert authentication, as well. To use it, simply pass I think this should close the issue; if not, let me know, and I'll reopen it. |
Terrific! Apologies I didn't get around to rebasing in time. Will test ASAP. |
This was discovered while looking at adding certificate auth support to the Logstash Elasticsearch output, which uses Manticore via the Elasticsearch Ruby client (see this adapter).
A quick overview of the library pointed me upstream to the Apache HTTP Components library for fine-tuned SSL configuration, like per-connection truststore/keystore support. My initial attempt was to use the Manticore client constructor's block support, and set the
SSLContext
orSSLConnectionSocketFactory
on theHttpClientBuilder
object in the block. Unfortunately, this did not work. Some digging revealed this note in upstream docs forHttpClientBuilder#setSSLSocketFactory
:Please note this value can be overridden by the setConnectionManager(org.apache.http.conn.HttpClientConnectionManager) method.
Unfortunately, this method is called by the Manticore client constructor, indirectly.Ultimately, (as hinted at in #7 and #8) it seems the only place in the Manticore client where SSL can be configured thoroughly is in
Manticore::Client#pool_builder
, which is a bit counterintuitive, I think.I'd like to propose that
pool_builder
be refactored to always explicitly configure Plain and SSL socket factories, deferring to anssl_ctx_builder
(or similar) method for the latter.Ultimately, it probably makes sense for Manticore to abstract the common SSL settings, and configure the underlying library on the user's behalf, given the increasing relevance of HTTPS, and the confusing workflow currently required, however I wanted to reach out before adding 4+ configuration options (minimally, truststore+password, keystore+password - ideally support would also include ciphers and other details), to see upstream has a preference on configuration parameter naming. If there's interest, I'm happy to contribute my scratch code towards a patch.
The text was updated successfully, but these errors were encountered: