-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Accept private key for TLS server without passphrase #1575
Conversation
@@ -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 |
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
test/plugin_helper/test_server.rb
Outdated
@@ -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| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nedd data
?
test/plugin_helper/test_server.rb
Outdated
@@ -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| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
83d5f16
to
d094045
Compare
Updated. |
It is convenient for users to leave the way to manage private keys to them like other many middlewares.