|
@@ -47,6 +47,7 @@ import javax.net.SocketFactory;
|
|
|
import org.apache.commons.logging.Log;
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
import org.apache.hadoop.conf.Configuration;
|
|
|
+import org.apache.hadoop.fs.CommonConfigurationKeys;
|
|
|
import org.apache.hadoop.io.DataOutputBuffer;
|
|
|
import org.apache.hadoop.io.IOUtils;
|
|
|
import org.apache.hadoop.io.Writable;
|
|
@@ -87,6 +88,8 @@ public class Client {
|
|
|
|
|
|
private SocketFactory socketFactory; // how to create sockets
|
|
|
private int refCount = 1;
|
|
|
+
|
|
|
+ private final boolean fallbackAllowed;
|
|
|
|
|
|
final private static String PING_INTERVAL_NAME = "ipc.ping.interval";
|
|
|
final static int DEFAULT_PING_INTERVAL = 60000; // 1 min
|
|
@@ -396,7 +399,8 @@ public class Client {
|
|
|
private synchronized boolean setupSaslConnection(final InputStream in2,
|
|
|
final OutputStream out2)
|
|
|
throws IOException {
|
|
|
- saslRpcClient = new SaslRpcClient(authMethod, token, serverPrincipal);
|
|
|
+ saslRpcClient = new SaslRpcClient(authMethod, token, serverPrincipal,
|
|
|
+ fallbackAllowed);
|
|
|
return saslRpcClient.saslConnect(in2, out2);
|
|
|
}
|
|
|
|
|
@@ -971,6 +975,8 @@ public class Client {
|
|
|
this.valueClass = valueClass;
|
|
|
this.conf = conf;
|
|
|
this.socketFactory = factory;
|
|
|
+ this.fallbackAllowed = conf.getBoolean(CommonConfigurationKeys.IPC_CLIENT_FALLBACK_TO_SIMPLE_AUTH_ALLOWED_KEY,
|
|
|
+ CommonConfigurationKeys.IPC_CLIENT_FALLBACK_TO_SIMPLE_AUTH_ALLOWED_DEFAULT);
|
|
|
}
|
|
|
|
|
|
/**
|