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

Add support for TLS Mutual authentication within forward input #1861

Merged
merged 1 commit into from
Mar 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/fluent/plugin_helper/cert_option.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ def cert_option_create_context(version, insecure, ciphers, conf)
ctx.ciphers = ciphers
end

if conf.client_cert_auth
ctx.verify_mode = OpenSSL::SSL::VERIFY_PEER | OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT
end

ctx.ca_file = conf.ca_path
ctx.cert = cert
ctx.key = key
if extra && !extra.empty?
Expand Down
4 changes: 3 additions & 1 deletion lib/fluent/plugin_helper/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def server_create_for_tls_connection(shared, bind, port, conf, backlog, socket_o

SERVER_TRANSPORT_PARAMS = [
:protocol, :version, :ciphers, :insecure,
:cert_path, :private_key_path, :private_key_passphrase,
:ca_path, :cert_path, :private_key_path, :private_key_passphrase, :client_cert_auth,
:ca_cert_path, :ca_private_key_path, :ca_private_key_passphrase,
:generate_private_key_length,
:generate_cert_country, :generate_cert_state, :generate_cert_state,
Expand Down Expand Up @@ -271,9 +271,11 @@ module ServerTransportParams
config_param :insecure, :bool, default: false

# Cert signed by public CA
config_param :ca_path, :string, default: nil
config_param :cert_path, :string, default: nil
config_param :private_key_path, :string, default: nil
config_param :private_key_passphrase, :string, default: nil, secret: true
config_param :client_cert_auth, :bool, default: false

# Cert generated and signed by private CA Certificate
config_param :ca_cert_path, :string, default: nil
Expand Down