CA Trusted Fingerprint Support Mixin
This gem provides tooling for adding a ca_trusted_fingerprint
option to Logstash Plugins that maps to an Apache SSL TrustStrategy
for use by Manticore or Apache HTTP client.
Usage
Add version
~>1.0
of this gem as a runtime dependency of your Logstash plugin'sgemspec
:Gem::Specification.new do |s| # ... s.add_runtime_dependency 'logstash-mixin-ca_trusted_fingerprint_support', '~>1.0' end
In your plugin code, require this library and include it into your plugin class that already inherits
LogStash::Plugin
:require 'logstash/plugin_mixins/ca_trusted_fingerprint_support' class LogStash::Inputs::Foo < Logstash::Inputs::Base # config :ca_trusted_fingerprint, :validate => :sha_256_hex include LogStash::PluginMixins::CATrustedFingerprintSupport # ... end
Use the provided
trust_strategy_for_ca_trusted_fingerprint
method to acquire an appropriate trust strategy for the givenca_trusted_fingerprint
(s), ornil
if noca_trusted_fingerprint
s were provided.def register # ... .merge(:trust_strategy, trust_strategy_for_ca_trusted_fingerprint) @client = Manticore::Client.new(ssl: ) end
Development
This gem:
- MUST remain API-stable at 1.x
- MUST NOT introduce additional runtime dependencies