-
Notifications
You must be signed in to change notification settings - Fork 7.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
ZOOKEEPER-3176: Quorum TLS - add SSL config options #681
Conversation
Refer to this link for build results (access rights to CI server needed): |
38b636e
to
550c9b7
Compare
Refer to this link for build results (access rights to CI server needed): |
f1501e3
to
45ec833
Compare
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
45ec833
to
d0c38d7
Compare
I should mention that this code has been internally reviewed at Facebook, has been landed on our internal fork, and has been running in production for weeks. |
Refer to this link for build results (access rights to CI server needed): |
0e4c55a
to
94ee042
Compare
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
d0d2943
to
3ddba01
Compare
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
327ced4
to
4b9ee4e
Compare
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
4b9ee4e
to
cf1a4e2
Compare
Refer to this link for build results (access rights to CI server needed): |
cf1a4e2
to
515c059
Compare
Refer to this link for build results (access rights to CI server needed): |
befadaf
to
70051f9
Compare
Refer to this link for build results (access rights to CI server needed): |
758873f
to
618732b
Compare
90fd62e
to
0eae6a0
Compare
0eae6a0
to
d87d6f3
Compare
d87d6f3
to
77aeafe
Compare
77aeafe
to
175559b
Compare
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.
+1 Awesome patch.
Just a small nitpick.
* since we can create different X509Util instances with different configurations in a single test process, and | ||
* unit test interactions between them. | ||
*/ | ||
public class SSLContextAndOptions { |
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.
I think this class is big enough to live in a separate file.
175559b
to
03b257b
Compare
03b257b
to
f09b970
Compare
@anmolnar done |
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.
+1 Great work!
Add SSL config options for enabled protocols and client auth mode. Improve handling of SSL config options for protocols and cipher suites - previously these came from system properties, now they can come from ZKConfig which means they are easier to isolate in tests, and now we don't need to parse system properties every time we create a secure socket. ## Added more options for ssl settings to X509Util and encapsulate them better - previously, some SSL settings came from a `ZKConfig` and others came from global `System.getProperties()`. This made it hard to isolate certain settings in tests. - now all SSL-related settings come from the `ZKConfig` object used to create the SSL context - new settings added: - `zookeeper.ssl(.quorum).enabledProtocols` - list of enabled protocols. If not set, defaults to a single-entry list with the value of `zookeeper.ssl(.quorum).protocol`. - `zookeeper.ssl(.quorum).clientAuth` - can be "NONE", "WANT", or "NEED". This controls whether the server doesn't want / allows / requires the client to present an X509 certificate. - `zookeeper.ssl(.quorum).handshakeDetectionTimeoutMillis` - timeout for the first read of 5 bytes to detect the transport mode (TLS or plaintext) of a client connection made to a `UnifiedServerSocket` Author: Ilya Maykov <[email protected]> Reviewers: [email protected] Closes #681 from ivmaykov/ZOOKEEPER-3176 (cherry picked from commit 0f44fd9) Signed-off-by: Andor Molnar <[email protected]>
Merged to master and 3.5 branches. |
Add SSL config options for enabled protocols and client auth mode. Improve handling of SSL config options for protocols and cipher suites - previously these came from system properties, now they can come from ZKConfig which means they are easier to isolate in tests, and now we don't need to parse system properties every time we create a secure socket. ## Added more options for ssl settings to X509Util and encapsulate them better - previously, some SSL settings came from a `ZKConfig` and others came from global `System.getProperties()`. This made it hard to isolate certain settings in tests. - now all SSL-related settings come from the `ZKConfig` object used to create the SSL context - new settings added: - `zookeeper.ssl(.quorum).enabledProtocols` - list of enabled protocols. If not set, defaults to a single-entry list with the value of `zookeeper.ssl(.quorum).protocol`. - `zookeeper.ssl(.quorum).clientAuth` - can be "NONE", "WANT", or "NEED". This controls whether the server doesn't want / allows / requires the client to present an X509 certificate. - `zookeeper.ssl(.quorum).handshakeDetectionTimeoutMillis` - timeout for the first read of 5 bytes to detect the transport mode (TLS or plaintext) of a client connection made to a `UnifiedServerSocket` Author: Ilya Maykov <[email protected]> Reviewers: [email protected] Closes apache#681 from ivmaykov/ZOOKEEPER-3176
Add SSL config options for enabled protocols and client auth mode.
Improve handling of SSL config options for protocols and cipher suites - previously these came from system properties, now they can come from ZKConfig which means they are easier to isolate in tests, and now we don't need to parse system properties every time we create a secure socket.
Added more options for ssl settings to X509Util and encapsulate them better
ZKConfig
and others came from globalSystem.getProperties()
. This made it hard to isolate certain settings in tests.ZKConfig
object used to create the SSL contextzookeeper.ssl(.quorum).enabledProtocols
- list of enabled protocols. If not set, defaults to a single-entry list with the value ofzookeeper.ssl(.quorum).protocol
.zookeeper.ssl(.quorum).clientAuth
- can be "NONE", "WANT", or "NEED". This controls whether the server doesn't want / allows / requires the client to present an X509 certificate.zookeeper.ssl(.quorum).handshakeDetectionTimeoutMillis
- timeout for the first read of 5 bytes to detect the transport mode (TLS or plaintext) of a client connection made to aUnifiedServerSocket