提交 6dd6226f 编写于 作者: W william.liangf

DUBBO-351 zookeeper注册中心权限验证不能通过

git-svn-id: http://code.alibabatech.com/svn/dubbo/trunk@1606 1a56cb94-b969-4eaa-88fa-be21384802f2
上级 d062ff6a
......@@ -254,6 +254,15 @@ public final class URL implements Serializable {
return password;
}
public String getAuthority() {
if ((username == null || username.length() == 0)
&& (password == null || password.length() == 0)) {
return null;
}
return (username == null ? "" : username)
+ ":" + (password == null ? "" : password);
}
public String getHost() {
return host;
}
......
......@@ -249,7 +249,7 @@ public class ZookeeperRegistry extends FailbackRegistry {
}
});
if (auth) {
zk.addAuthInfo(url.getUsername(), url.getPassword().getBytes());
zk.addAuthInfo("digest", url.getAuthority().getBytes());
}
return zk;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册