diff --git a/bin/fluent-ca-generate b/bin/fluent-ca-generate new file mode 100755 index 0000000000..6037c7fce3 --- /dev/null +++ b/bin/fluent-ca-generate @@ -0,0 +1,6 @@ +#!/usr/bin/env ruby + +$LOAD_PATH.unshift(File.join(__dir__, 'lib')) +require 'fluent/command/ca_generate' + +Fluent::CaGenerate.new.call diff --git a/lib/fluent/command/ca_generate.rb b/lib/fluent/command/ca_generate.rb new file mode 100644 index 0000000000..74b67afc3f --- /dev/null +++ b/lib/fluent/command/ca_generate.rb @@ -0,0 +1,179 @@ +require 'openssl' +require 'optparse' +require 'fileutils' + +module Fluent + class CaGenerate + DEFAULT_OPTIONS = { + private_key_length: 2048, + cert_country: 'US', + cert_state: 'CA', + cert_locality: 'Mountain View', + cert_common_name: 'Fluentd Forward CA', + } + HELP_TEXT = <