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

Accept private key for TLS server without passphrase #1575

Merged
merged 1 commit into from
May 23, 2017

Conversation

mururu
Copy link
Member

@mururu mururu commented May 18, 2017

It is convenient for users to leave the way to manage private keys to them like other many middlewares.

@mururu mururu requested a review from repeatedly May 18, 2017 04:40
@@ -46,12 +46,10 @@ def cert_option_server_validate!(conf)
case
when conf.cert_path
raise Fluent::ConfigError, "private_key_path is required when cert_path is specified" unless conf.private_key_path
raise Fluent::ConfigError, "private_key_passphrase is required when cert_path is specified" unless conf.private_key_passphrase
Copy link
Member

Choose a reason for hiding this comment

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

How about logging warn message like "For security reason, setting private_key_passphrase is recommended"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fair enough.

cert_option_load(conf.cert_path, conf.private_key_path, conf.private_key_passphrase)

when conf.ca_cert_path
raise Fluent::ConfigError, "ca_private_key_path is required when ca_cert_path is specified" unless conf.ca_private_key_path
raise Fluent::ConfigError, "ca_private_key_passphrase is required when ca_cert_path is specified" unless conf.ca_private_key_passphrase
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@@ -982,7 +985,7 @@ def open_tls_session(addr, port, verify: true, cert_path: nil, selfsigned: true,
assert_equal "yay\nfoo\n", received
end

test 'load chained server cert by private CA cert file, verified from clients using CA cert file as root' do
test 'load chained server cert by private CA cert file, verified from clients using CA cert file as root' do |ca_key_passphrase, private_key_passphrase|
Copy link
Member

Choose a reason for hiding this comment

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

Nedd data?

@@ -1137,20 +1142,18 @@ def open_tls_session(addr, port, verify: true, cert_path: nil, selfsigned: true,
assert_equal "yay\nfoo\n", received
end

test 'load chained server cert by private CA cert file, verified from clients using CA cert file as root' do
test 'load chained server cert by private CA cert file, verified from clients using CA cert file as root' do |ca_key_passphrase, private_key_passphrase|
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@mururu mururu force-pushed the private-key-without-passphrase branch from 83d5f16 to d094045 Compare May 22, 2017 10:00
@mururu
Copy link
Member Author

mururu commented May 22, 2017

Updated.

@repeatedly repeatedly merged commit c83e2a1 into fluent:master May 23, 2017
@mururu mururu deleted the private-key-without-passphrase branch May 23, 2017 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants