Github user sohami commented on a diff in the pull request:
https://github.com/apache/drill/pull/950#discussion_r140133705
--- Diff: exec/rpc/src/main/java/org/apache/drill/exec/rpc/BasicClient.java
---
@@ -100,6 +103,8 @@ protected void initChannel(SocketChannel ch) throws
Exception {
ch.closeFuture().addListener(getCloseHandler(ch, connection));
final ChannelPipeline pipe = ch.pipeline();
+ // Make sure that the SSL handler is the first handler in the
pipeline so everything is encrypted
+ setupSSL(pipe, sslHandshakeListener);
--- End diff --
this will be called all the time even when SSL is not enabled and then
later we have a check inside setupSSL where we are doing all the setup inside
that if condition. How about check that here instead and then calling setupSSL
method based on that check ? That way we know setupSSL is to do some setup and
will be called only when SSL is enabled.
```
if (isSslEnabled()) {
sslHandshakeListener = new
ConnectionMultiListener.SSLHandshakeListener();
setupSSL(pipe, sslHandshakeListener);
}
```
and then remove that check from inside the setupSSL method.
---